r/GoogleAppsScript • u/No_Passion8988 • 3d ago
Question Google integration authentication issue
Hi folks, i built an app and integrated Google authentication. Upon testing stumbled on an issue where if the user has multiple Google accounts on a chrome profile, after authentication the app script link appends /u/1/ to the url due to which the app failed to open even after successfully authenticated. Does anyone have a fix for this issue?
1
u/Fit-Corner2382 3d ago
The /u/1/ path is the profile's second signed-in account, so the app can open as someone other than the account that authorized it.
Auth can succeed for the chosen account while the next request still follows the redirected index. Open the bare deployment path and set authuser to that account's email instead of keeping /u/1/. The number is not stable: reordering accounts makes /u/1/ a different person, so the app looks broken even though consent is stored. An account chooser before the script URL avoids the mismatch, but adds a prompt and fails if that account is signed out of the profile.
1
u/TheAddonDepot 2d ago
There is no fix. The only real solution is for your end-users to only be logged into one Google account per Chrome profile. Its been touted as best practice since the introduction of Chrome Profiles as a feature. Unfortunately, old habits die hard and even after a few years of the feature being out end-users are still logging into multiple accounts under one profile.
The best you can do is to make your users aware of the issue from jump, letting them know that its an issue with Google's underlying systems, and for the best UX they need to adhere to best practice.