mirror of
https://github.com/ysoftdevs/oauth-playground-server.git
synced 2026-05-27 09:59:12 +02:00
remove deprecated error constructor
This commit is contained in:
@@ -25,14 +25,12 @@ public class OAuthResource {
|
||||
@POST
|
||||
@Produces(MediaType.TEXT_HTML)
|
||||
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
|
||||
public Object post(AuthParams params,
|
||||
@FormParam("sessionId") String sessionId,
|
||||
public Object post(@FormParam("sessionId") String sessionId,
|
||||
@FormParam("username") String username,
|
||||
@FormParam("password") String password,
|
||||
@FormParam("scope") List<String> scopes) {
|
||||
@FormParam("password") String password) {
|
||||
|
||||
|
||||
sessionsRepo.getSession(sessionId).orElseThrow(() -> new OAuthException("Invalid session"));
|
||||
sessionsRepo.getSession(sessionId).orElseThrow(() -> new OAuthException(ErrorResponse.Error.access_denied, "Invalid session"));
|
||||
var user = validateUser(username, password);
|
||||
if (user == null) {
|
||||
return Templates.login(username, sessionId, "invalid_credentials");
|
||||
@@ -67,7 +65,7 @@ public class OAuthResource {
|
||||
@FormParam("sessionId") String sessionId,
|
||||
@FormParam("scope") List<String> scopes) {
|
||||
|
||||
sessionsRepo.getSession(sessionId).orElseThrow(() -> new OAuthException("Invalid session"));
|
||||
sessionsRepo.getSession(sessionId).orElseThrow(() -> new OAuthException(ErrorResponse.Error.access_denied, "Invalid session"));
|
||||
var session = sessionsRepo.authorizeSession(sessionId, scopes);
|
||||
|
||||
String redirectUri = session.params().getRedirectUri();
|
||||
|
||||
@@ -12,11 +12,6 @@ public class OAuthException extends RuntimeException {
|
||||
this(new ErrorResponse(error, description));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public OAuthException(String message) {
|
||||
this(ErrorResponse.Error.server_error, message);
|
||||
}
|
||||
|
||||
public ErrorResponse getResponse() {
|
||||
return response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user