]> source.dussan.org Git - gitea.git/commit
Fixing redirection issue for logged-in users (#26105)
authorcassiozareck <121526696+cassiozareck@users.noreply.github.com>
Thu, 27 Jul 2023 05:08:51 +0000 (02:08 -0300)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2023 05:08:51 +0000 (13:08 +0800)
commit73fb1ecdcf7c72c9b15caa70a8e3f444d311bd7b
treeeb3730df237f65e2b3177c2e2c3d2c36984b7cad
parentc6975e583a738f4ab4edb7269e419e3bcdb8a660
Fixing redirection issue for logged-in users (#26105)

This PR addresses an issue where logged-in users get redirected to the
homepage when trying to access a URL with the redirect_to parameter. The
issue was traced back to a middleware function in
services/auth/middleware.go that redirects logged-in users to the
homepage. This function didn't account the redirect_to parameter.

The fix modifies the middleware function to check for this case and
redirect the user to the specified URL instead of the homepage.

Closes: #26005
---------

Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
routers/web/web.go