Return 401 instead 403 when authenticating an user (#734)

Co-authored-by: Francisco Zanini <francisco@digifort.com.br>
This commit is contained in:
Francisco Zanini 2024-02-27 17:17:34 -03:00 committed by GitHub
parent 833195243e
commit a7ea6c8369
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -420,7 +420,7 @@ begin
begin
FAuthenticationHandler.OnAuthentication(AContext, LUsername, LPassword, LRolesList, LIsValid, LSessionData);
if not LIsValid then
raise EMVCJWTException.Create(HTTP_STATUS.Forbidden, 'Forbidden');
raise EMVCJWTException.Create(HTTP_STATUS.Unauthorized, 'Unauthorized');
end;
LJWTValue := TJWT.Create(FSecret, FLeewaySeconds);