aboutsummaryrefslogtreecommitdiff
path: root/handlers.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-11 12:54:00 +0100
committerSimon Ser <contact@emersion.fr>2019-12-11 12:54:03 +0100
commit86359156ee607bc3ddac99cf9a6295f8ff664482 (patch)
treea921b9de2095b18e6b821b6d26dd9aa019980e21 /handlers.go
parentd8f411176fc63c8330987db2450c04b5c64b0dd9 (diff)
downloadalps-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.go4
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")
}