Fix 401 Error When Logging in with Google After Logout from Organization Context

When a user logs into an account and content-switches to an organization, then performs a logout, attempting to log in again using Google credentials results in a 401 Unauthorized error.

Steps to Reproduce:

  1. Login to the platform using any method (e.g., email/password or Google).

  2. Switch context to an organization.

  3. Perform a logout action.

  4. Attempt to log in again using Google authentication.

Expected Behavior:

The user should be successfully logged in using Google credentials and redirected to the appropriate dashboard.

Actual Behavior:

A 401 Unauthorized error is returned after trying to log in with Google.

Impact:

Users who switch to an organization and log out are unable to log in again with Google, creating a blocker and negatively affecting user experience.

I tested with two differents organizations:

Org 1

https://sharing.clickup.com/clip/p/t9004002740/d543257b-115d-49ef-a2bb-63dd2061176a/screen-recording-2025-06-09-17%3A07.webm


Org 2

https://sharing.clickup.com/clip/p/t9004002740/6b5787b0-91db-4a1a-a94f-48184beefb83/screen-recording-2025-06-09-17%3A08.webm

Domain
AuthN-Z
Action
fix
Department
Backend

Please authenticate to join the conversation.

Upvoters
Status

Not Required

Board
๐Ÿ› ๏ธ

Bug & Fixes

Date

10 months ago

Author

Mattia Vaccari

Subscribe to post

Get notified by email when there are changes.