Commit b872acb4 by Jan Hrabal

merge

parent cff5d984
...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
...@@ -154,7 +155,13 @@ public class AuthApiController { ...@@ -154,7 +155,13 @@ public class AuthApiController {
return ResponseEntity.notFound().build(); return ResponseEntity.notFound().build();
} }
Utils.sleep(250); Utils.sleep(250);
String token = authService.generateResetToken(request.getLogin()); try {
authService.generateResetToken(request.getLogin());
} catch (BadCredentialsException e) {
//throw new RestApiException(HttpStatus.FORBIDDEN);
} catch (Exception e) {
throw new RestApiException(HttpStatus.INTERNAL_SERVER_ERROR);
}
return ResponseEntity.accepted().build(); return ResponseEntity.accepted().build();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment