mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 21:15:49 +01:00
Fix redirect path to the context root.
This commit is contained in:
@@ -42,12 +42,12 @@ trait SignInControllerBase extends ControllerBase { self: SystemSettingsService
|
||||
session.setAttribute("LOGIN_ACCOUNT", account)
|
||||
updateLastLoginDate(account.userName)
|
||||
|
||||
session.get("REDIRECT").map { redirectUrl =>
|
||||
session.get("REDIRECT").map { case redirectUrl: String =>
|
||||
session.removeAttribute("REDIRECT")
|
||||
if(redirectUrl == request.getContextPath + "/"){
|
||||
if(redirectUrl.replaceFirst("/$", "") == request.getContextPath){
|
||||
redirect("/")
|
||||
} else {
|
||||
redirect(redirectUrl.asInstanceOf[String])
|
||||
redirect(redirectUrl)
|
||||
}
|
||||
}.getOrElse {
|
||||
redirect("/")
|
||||
|
||||
Reference in New Issue
Block a user