diff options
author | Simon Ser <contact@emersion.fr> | 2019-12-11 12:54:00 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-12-11 12:54:03 +0100 |
commit | 86359156ee607bc3ddac99cf9a6295f8ff664482 (patch) | |
tree | a921b9de2095b18e6b821b6d26dd9aa019980e21 /handlers.go | |
parent | d8f411176fc63c8330987db2450c04b5c64b0dd9 (diff) | |
download | alps-86359156ee607bc3ddac99cf9a6295f8ff664482.tar.gz alps-86359156ee607bc3ddac99cf9a6295f8ff664482.zip |
Export Context.SetSession, unexport Session.Token
I'm uneasy exposing the token to plugins, I prefer to hide it if
possible to prevent mis-use.
This change allows plugins to logout users.
Diffstat (limited to 'handlers.go')
-rw-r--r-- | handlers.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/handlers.go b/handlers.go index 2ee4c8f..4919d33 100644 --- a/handlers.go +++ b/handlers.go @@ -89,7 +89,7 @@ func handleLogin(ectx echo.Context) error { } return fmt.Errorf("failed to put connection in pool: %v", err) } - ctx.setToken(s.Token) + ctx.SetSession(s) return ctx.Redirect(http.StatusFound, "/mailbox/INBOX") } @@ -101,7 +101,7 @@ func handleLogout(ectx echo.Context) error { ctx := ectx.(*Context) ctx.Session.Close() - ctx.setToken("") + ctx.SetSession(nil) return ctx.Redirect(http.StatusFound, "/login") } |