From 24718f1ac4f892b0e304189ddc21825ff59fb28d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 10 Jan 2020 17:29:37 +0100 Subject: Redirect to original URL after login --- plugins/base/routes.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') 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") } -- cgit v1.2.3-59-g8ed1b