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

Auth provider 401 response required changes #839

Open
4 tasks
elboletaire opened this issue Nov 15, 2024 · 0 comments
Open
4 tasks

Auth provider 401 response required changes #839

elboletaire opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@elboletaire
Copy link
Member

The "unauthorized user" error should not be logging out users, otherwise we may accidentally logout users when trying to access some section they don't have permission to access.

An example of this is a user who's not admin of an organization. Right now a manager can list members of an organization, but in the same page we also try to get pending invitations, to which managers don't have (at least yet) permission to access, resulting on a logout for the user.

Required changes:

  • Do not logout for the 40001 error.
  • Assess not logging out on any error 401
  • Always show a toast before logging out or doing any other action related to error 401
  • Assess redirecting users to the login page (which should redirect them to /admin if they have the session started). I'm not sure about this, since the case I've exposed before would not allow the user to see part of the information where they're allowed to access.
@elboletaire elboletaire added the bug Something isn't working label Nov 15, 2024
elboletaire added a commit that referenced this issue Nov 15, 2024
- Created #839 to tackle an issue I've found doing this
- Changed how the auth.ts routes were sorted in order to be able to
  reuse the AuthLayout without requiring an account to not be logged in.
- Updated the signup component to be reused in the verification for
  non-existing accounts.
- Minor changes to AuthProvider to have errors in an Enum
- Most if not all cases covered, but the verification process needs a
  revamp:
  + If the invited user has an unverified account, a page with a button to
    go to the verify page is shown, but such verify requires the params in
    the URL, which cannot be get from this point (at all). The verify user
    needs a revamp so it can be accessed without url params, and show
    there a button to request a new code if required
elboletaire added a commit that referenced this issue Nov 19, 2024
* Fix issues related to the Team view
* Fix accidentaly changed props
* Remove unnecessary (and confusing) form default value
* Moved utils to new utils folder
* Implement invite to team logic (or most of it)
- Added new CallbackProvider to easily add success/error callbacks to
  components
* Fix teams list in account not showing team name
* Implement pending members list
- Moved team members table to a new component and edited that one to use
  the common component instead
- Created a new PendingTeamMembersList component to show the pending
  members table/list
- Created a new wrapper component to have both of them as <TeamMembers
  />
* Implemented roles call
* Fix query cache not properly cleaned when inviting someone
Also changed the order of the members table order to be more consistent
* Properly select data structure using react-query
* Recover roles border radius
* Properly show both member lists in team
* Set isLoading to team invite form button
* Update translations
* Accept invitation flow
- Created #839 to tackle an issue I've found doing this
- Changed how the auth.ts routes were sorted in order to be able to
  reuse the AuthLayout without requiring an account to not be logged in.
- Updated the signup component to be reused in the verification for
  non-existing accounts.
- Minor changes to AuthProvider to have errors in an Enum
- Most if not all cases covered, but the verification process needs a
  revamp:
  + If the invited user has an unverified account, a page with a button to
    go to the verify page is shown, but such verify requires the params in
    the URL, which cannot be get from this point (at all). The verify user
    needs a revamp so it can be accessed without url params, and show
    there a button to request a new code if required
* Minor translation changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant