From 86359156ee607bc3ddac99cf9a6295f8ff664482 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 11 Dec 2019 12:54:00 +0100 Subject: 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. --- handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'handlers.go') 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") } -- cgit v1.2.3-59-g8ed1b