Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[frontend/backend] correct logout redirection #1790

Merged
merged 4 commits into from
Nov 4, 2024
Merged

[frontend/backend] correct logout redirection #1790

merged 4 commits into from
Nov 4, 2024

Conversation

MarineLeM
Copy link
Contributor

@MarineLeM MarineLeM commented Oct 31, 2024

Close : #1778

The user creation functionality worked correctly.
However, the issue was when clicking the logout button: the page displayed the login form, but the URL did not update accordingly.

Moreover i update the status code in the back
when a user is connected but don't have access the api return 404
when a user is not connected anymore and want to have access to some information the api return 401

Signed-off-by: Marine LM <marine.lemezo@filigran.io>
@MarineLeM MarineLeM self-assigned this Oct 31, 2024
@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Oct 31, 2024
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 32.12%. Comparing base (79b8230) to head (89d5579).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...main/java/io/openbas/rest/helper/RestBehavior.java 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1790      +/-   ##
============================================
+ Coverage     32.07%   32.12%   +0.05%     
- Complexity     1609     1626      +17     
============================================
  Files           561      561              
  Lines         16845    17119     +274     
  Branches        973     1009      +36     
============================================
+ Hits           5403     5500      +97     
- Misses        11198    11373     +175     
- Partials        244      246       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…page

Signed-off-by: Marine LM <marine.lemezo@filigran.io>
@damgouj damgouj self-requested a review October 31, 2024 13:10
@guillaumejparis guillaumejparis self-requested a review October 31, 2024 13:17
Signed-off-by: Marine LM <marine.lemezo@filigran.io>
@MarineLeM MarineLeM changed the title [frontend] correct logout redirection [frontend/backend] correct logout redirection Oct 31, 2024
@@ -92,7 +93,7 @@ public ValidationErrorBag handleBadRequestExceptions(ImportException ex) {
}

@ResponseStatus(HttpStatus.UNAUTHORIZED)
@ExceptionHandler(AccessDeniedException.class)
@ExceptionHandler(AuthenticationException.class)
public ValidationErrorBag handleValidationExceptions() {
ValidationErrorBag bag =
new ValidationErrorBag(HttpStatus.UNAUTHORIZED.value(), "ACCESS_DENIED");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change default message for something more meaningful as UNATHORIZED is described as : "it lacks valid authentication credentials for the requested resource"

Signed-off-by: Marine LM <marine.lemezo@filigran.io>
@MarineLeM MarineLeM merged commit 5c610aa into master Nov 4, 2024
7 checks passed
@MarineLeM MarineLeM deleted the issue/1778 branch November 4, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-admin user granted for a simulation not able to access it
3 participants