Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
fix(login redirect): prevent redirect to login page after login
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed Dec 1, 2015
1 parent e165762 commit d064326
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/release-notes.md
Expand Up @@ -27,6 +27,8 @@
* [ZNTA-639](https://zanata.atlassian.net/browse/ZNTA-639) - Expired sessions causing ViewExpiredExceptions
* [ZNTA-720](https://zanata.atlassian.net/browse/ZNTA-720) - Redirect to login page after account activation
* [ZNTA-767](https://zanata.atlassian.net/browse/ZNTA-767) - File names / paths with spaces cannot be navigated to via the Documents tab. **Note:** This will invalidate all existing bookmarked URL with selected document in the project version page.
* [ZNTA-815](https://zanata.atlassian.net/browse/ZNTA-815) - New user login redirected to login screen again instead of Dashboard


-----------------------

Expand Down
Expand Up @@ -50,6 +50,7 @@ public class UserRedirectBean implements Serializable {
private static final String HOME_URL = "/";
private static final String REGISTER_URL = "/register";
private static final String ERROR_URL = "/error";
private static final String LOGIN_URL = "/sign_in";

/**
*
Expand Down Expand Up @@ -166,9 +167,13 @@ public boolean isRedirectToRegister() {
return isRedirectTo(REGISTER_URL);
}

public boolean isRedirectToLoginPage() {
return isRedirectTo(LOGIN_URL);
}

// provided user is logged in, they should be redirect to dashboard
public boolean shouldRedirectToDashboard() {
return isRedirectToHome() || isRedirectToRegister();
return isRedirectToHome() || isRedirectToRegister() || isRedirectToLoginPage();
}

private boolean isRedirectTo(String url) {
Expand Down

0 comments on commit d064326

Please sign in to comment.