-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(auth): add 401 response to member invite #80800
base: master
Are you sure you want to change the base?
Conversation
❌ 22 Tests Failed:
View the top 3 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chatted in slack, but i think we should make sure we are properly fetching the invite context for the org member being invited before adding the new 401 response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very elegant. test pls
# render a view prompting the user to log out and try again. | ||
if not isinstance(request.user, AnonymousUser): | ||
if organization_member.email != request.user.email: | ||
return self.respond_unauthorized(request.user.email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we test returning this 401?
In the event that a user is logged into Sentry with an account that is different than the account invited to join an organization, we wish to prompt them to log out and try again. To do this, we introduce a 401 UNAUTHORIZED response if the requesting user's email does not match the email in the invite context.
This does not result in any changes on the user side, because the same warning message is rendered for all errors. Frontend changes will come in a subsequent PR.