Skip to content

Commit

Permalink
fix: Handle invitation links with invalid auth token (#9741)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschoordsch authored May 8, 2024
1 parent 9d2fa5f commit 162de5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/mutations/AcceptTeamInvitationMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ const AcceptTeamInvitationMutation: StandardMutation<
const serverError = getGraphQLError(data, errors)
if (serverError) {
const message = serverError.message
if (message === InvitationTokenError.ALREADY_ACCEPTED) {
if (message === InvitationTokenError.NOT_SIGNED_IN) {
// if the user follows an invitation link with an invalid auth token, invalidate it
atmosphere.setAuthToken(null)
} else if (message === InvitationTokenError.ALREADY_ACCEPTED) {
handleAuthenticationRedirect(acceptTeamInvitation, {
atmosphere,
history,
Expand Down

0 comments on commit 162de5e

Please sign in to comment.