diff options
author | Simon Ser <contact@emersion.fr> | 2020-01-10 17:29:37 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-01-10 17:29:37 +0100 |
commit | 24718f1ac4f892b0e304189ddc21825ff59fb28d (patch) | |
tree | 1a8d24f1b4c532f5eca44abc7012bd25980f8bda /plugins/base | |
parent | b014c1898fef294a58178c5d82266d6b24774f8d (diff) | |
download | alps-24718f1ac4f892b0e304189ddc21825ff59fb28d.tar.gz alps-24718f1ac4f892b0e304189ddc21825ff59fb28d.zip |
Redirect to original URL after login
Diffstat (limited to 'plugins/base')
-rw-r--r-- | plugins/base/routes.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go index e83c047..293d313 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -141,6 +141,9 @@ func handleLogin(ctx *koushin.Context) error { } ctx.SetSession(s) + if path := ctx.QueryParam("next"); path != "" && path[0] == '/' && path != "/login" { + return ctx.Redirect(http.StatusFound, path) + } return ctx.Redirect(http.StatusFound, "/mailbox/INBOX") } |