Skip to content

Commit

Permalink
#9 Fixing admin login behavior, now the same as regular login
Browse files Browse the repository at this point in the history
  • Loading branch information
tigreped committed Nov 26, 2015
1 parent 742f6f7 commit c2d811c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/main/java/br/gov/sibbr/api/controller/InterfaceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,11 @@ public String login(LoginForm loginForm, Model model) {
if (email != null && password != null) {
String message = authService.checkPassword(email, password);
if (message == null) {
if (email.equalsIgnoreCase(AuthService.ADMIN_EMAIL)) {

} else {
// Successful authentication with valid credentials, fetch
// user token:
// TODO: admin password is not working after password change
String token = authService.fetchToken(email);
if (token != null) {
model.addAttribute("token", token);
return "login_success";
}
// Successful authentication. Valid credentials, fetch user token:
String token = authService.fetchToken(email);
if (token != null) {
model.addAttribute("token", token);
return "login_success";
}
}
model.addAttribute("message", message);
Expand Down

0 comments on commit c2d811c

Please sign in to comment.