feature/Logout button should have redirect url which goes to the login page

This commit is contained in:
Marko Milić 2022-08-25 09:35:41 +02:00
parent 37df601ecb
commit 829e009e21
2 changed files with 3 additions and 2 deletions

View File

@ -939,7 +939,7 @@ def restoreSomeSessions(): Unit = {
* Overridden in order to add custom error message. Attention: Not calling super will change the default behavior!
*/
override protected def loginMenuLocParams: List[LocParam[Unit]] = {
lazy val errorMessage = " " + S.?("already.logged.in") + s" ${Constant.HostName}${AuthUser.logoutPath.foldLeft("")(_ + "/" + _)}"
org.scalameta.logger.elem(S.queryString)
If(notLoggedIn_? _, () => RedirectResponse("/already-logged-in")) ::
Template(() => wrapIt(login)) ::
Nil

View File

@ -425,7 +425,8 @@ class WebUI extends MdcLoggable{
def alreadyLoggedIn: CssSel = {
lazy val logoutLink = s" ${Constant.HostName}${AuthUser.logoutPath.foldLeft("")(_ + "/" + _)}"
"#logout_link [href]" #> scala.xml.Unparsed(logoutLink)
lazy val loginLink = s" ${Constant.HostName}${AuthUser.loginPath.foldLeft("")(_ + "/" + _)}"
"#logout_link [href]" #> scala.xml.Unparsed(s"$logoutLink?redirect=$loginLink")
}
def getStartedContentLoader: NodeSeq = {