mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Fix redirect path after sign in.
This commit is contained in:
@@ -58,9 +58,6 @@ trait AccountControllerBase extends AccountManagementControllerBase with FlashMa
|
|||||||
getAccountByUserName(userName).flatMap(_.image).map { image =>
|
getAccountByUserName(userName).flatMap(_.image).map { image =>
|
||||||
contentType = FileUtil.getMimeType(image)
|
contentType = FileUtil.getMimeType(image)
|
||||||
new java.io.File(getUserUploadDir(userName), image)
|
new java.io.File(getUserUploadDir(userName), image)
|
||||||
// } getOrElse {
|
|
||||||
// contentType = "image/png"
|
|
||||||
// Thread.currentThread.getContextClassLoader.getResourceAsStream("noimage.png")
|
|
||||||
} getOrElse NotFound
|
} getOrElse NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +83,11 @@ trait AccountControllerBase extends AccountManagementControllerBase with FlashMa
|
|||||||
|
|
||||||
get("/register"){
|
get("/register"){
|
||||||
if(loadSystemSettings().allowAccountRegistration){
|
if(loadSystemSettings().allowAccountRegistration){
|
||||||
|
if(context.loginAccount.isDefined){
|
||||||
|
redirect("/")
|
||||||
|
} else {
|
||||||
account.html.edit(None, None)
|
account.html.edit(None, None)
|
||||||
|
}
|
||||||
} else NotFound
|
} else NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ trait SignInControllerBase extends ControllerBase { self: SystemSettingsService
|
|||||||
session.removeAttribute("REDIRECT")
|
session.removeAttribute("REDIRECT")
|
||||||
redirect(redirectUrl.asInstanceOf[String])
|
redirect(redirectUrl.asInstanceOf[String])
|
||||||
}.getOrElse {
|
}.getOrElse {
|
||||||
redirect("/%s".format(account.get.userName))
|
redirect("/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user