mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Change hash field to Option[String].
This commit is contained in:
@@ -19,12 +19,12 @@ trait IndexControllerBase extends ControllerBase {
|
|||||||
self: RepositoryService with ActivityService with AccountService with RepositorySearchService
|
self: RepositoryService with ActivityService with AccountService with RepositorySearchService
|
||||||
with UsersAuthenticator with ReferrerAuthenticator =>
|
with UsersAuthenticator with ReferrerAuthenticator =>
|
||||||
|
|
||||||
case class SignInForm(userName: String, password: String, hash: String)
|
case class SignInForm(userName: String, password: String, hash: Option[String])
|
||||||
|
|
||||||
val signinForm = mapping(
|
val signinForm = mapping(
|
||||||
"userName" -> trim(label("Username", text(required))),
|
"userName" -> trim(label("Username", text(required))),
|
||||||
"password" -> trim(label("Password", text(required))),
|
"password" -> trim(label("Password", text(required))),
|
||||||
"hash" -> text()
|
"hash" -> trim(optional(text()))
|
||||||
)(SignInForm.apply)
|
)(SignInForm.apply)
|
||||||
|
|
||||||
// val searchForm = mapping(
|
// val searchForm = mapping(
|
||||||
@@ -87,7 +87,7 @@ trait IndexControllerBase extends ControllerBase {
|
|||||||
/**
|
/**
|
||||||
* Set account information into HttpSession and redirect.
|
* Set account information into HttpSession and redirect.
|
||||||
*/
|
*/
|
||||||
private def signin(account: Account, hash: String) = {
|
private def signin(account: Account, hash: Option[String]) = {
|
||||||
session.setAttribute(Keys.Session.LoginAccount, account)
|
session.setAttribute(Keys.Session.LoginAccount, account)
|
||||||
updateLastLoginDate(account.userName)
|
updateLastLoginDate(account.userName)
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ trait IndexControllerBase extends ControllerBase {
|
|||||||
if(redirectUrl.stripSuffix("/") == request.getContextPath){
|
if(redirectUrl.stripSuffix("/") == request.getContextPath){
|
||||||
redirect("/")
|
redirect("/")
|
||||||
} else {
|
} else {
|
||||||
redirect(redirectUrl + hash)
|
redirect(redirectUrl + hash.getOrElse(""))
|
||||||
}
|
}
|
||||||
}.getOrElse {
|
}.getOrElse {
|
||||||
redirect("/")
|
redirect("/")
|
||||||
|
|||||||
Reference in New Issue
Block a user