aboutsummaryrefslogtreecommitdiff
path: root/service/auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/auth.go')
-rw-r--r--service/auth.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/service/auth.go b/service/auth.go
index afb324a..dac0338 100644
--- a/service/auth.go
+++ b/service/auth.go
@@ -167,18 +167,19 @@ func (s *as) NewSession(ctx context.Context, instance string) (redirectUrl strin
}
func (s *as) Signin(ctx context.Context, c *model.Client, sessionID string,
- code string) (token string, err error) {
+ code string) (token string, userID string, err error) {
err = s.authenticateClient(ctx, c)
if err != nil {
return
}
- token, err = s.Service.Signin(ctx, c, c.Session.ID, code)
+ token, userID, err = s.Service.Signin(ctx, c, c.Session.ID, code)
if err != nil {
return
}
c.Session.AccessToken = token
+ c.Session.UserID = userID
err = s.sessionRepo.Add(c.Session)
if err != nil {
return
@@ -308,3 +309,15 @@ func (s *as) UnMuteConversation(ctx context.Context, c *model.Client, id string)
}
return s.Service.UnMuteConversation(ctx, c, id)
}
+
+func (s *as) Delete(ctx context.Context, c *model.Client, id string) (err error) {
+ err = s.authenticateClient(ctx, c)
+ if err != nil {
+ return
+ }
+ err = checkCSRF(ctx, c)
+ if err != nil {
+ return
+ }
+ return s.Service.Delete(ctx, c, id)
+}