You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manabu Nakamura edited this page May 11, 2013
·
3 revisions
Returning to the originally requested page after login
When an unauthenticated user requests access to page requiring authentication,
you first redirect the user to the login page, then, after the user successfully logs in, you redirect the user to the page they originally requested.
To achieve this change authenticationFailed and loginSucceeded:
traitAuthConfigImplextendsAuthConfig {
// Other settings are omitted.defauthenticationFailed(request: RequestHeader):Result=Redirect(routes.Application.login).withSession("access_uri"-> request.uri)
defloginSucceeded(request: RequestHeader):Result= {
valuri= request.session.get("access_uri").getOrElse(routes.Message.main.url.toString)
Redirect(uri).withSession(request.session -"access_uri")
}
}