Skip to content

Commit 451edeb

Browse files
committed
fix: update response code
Updated the response code for login failures from 403 Frobidden to 401 UnAuthorized to more accurately reflect the correct HTTP status code for authentication failures.
1 parent dc5d1d1 commit 451edeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

springdoc-openapi-starter-common/src/main/java/org/springdoc/core/configuration/SpringDocSecurityConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ OpenApiCustomizer springSecurityLoginEndpointCustomiser(ApplicationContext appli
147147
operation.requestBody(requestBody);
148148
ApiResponses apiResponses = new ApiResponses();
149149
apiResponses.addApiResponse(String.valueOf(HttpStatus.OK.value()), new ApiResponse().description(HttpStatus.OK.getReasonPhrase()));
150-
apiResponses.addApiResponse(String.valueOf(HttpStatus.UNAUTHORIZED.value()), new ApiResponse().description(HttpStatus.FORBIDDEN.getReasonPhrase()));
150+
apiResponses.addApiResponse(String.valueOf(HttpStatus.UNAUTHORIZED.value()), new ApiResponse().description(HttpStatus.UNAUTHORIZED.getReasonPhrase()));
151151
operation.responses(apiResponses);
152152
operation.addTagsItem("login-endpoint");
153153
PathItem pathItem = new PathItem().post(operation);

0 commit comments

Comments
 (0)