Merged
Conversation
The shared loginWithLinkedIn helper hardcoded ?platform=mobile and used WebBrowser.openAuthSessionAsync with a custom-scheme redirect, which broke the Expo web export at https://shatter-mobile.vercel.app/. After LinkedIn auth completed, the backend redirected the browser to shattermobile://auth/auth/callback?code=..., a custom scheme browsers cannot follow. Branch on Platform.OS: on web, navigate the current tab directly to the backend's /api/auth/linkedin (no platform param). The backend defaults to the web flow and redirects to ${FRONTEND_URL}/auth/callback?code=..., which the existing app/auth/callback.tsx route handles. The mobile path is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
loginWithLinkedInhelper hardcoded?platform=mobileand used a custom-scheme redirect, which broke LinkedIn login on the Expo web export at https://shatter-mobile.vercel.app/Platform.OS: on web, navigate the current tab directly to${API_BASE}/api/auth/linkedin(noplatformparam). Backend defaults to the web flow and redirects to${FRONTEND_URL}/auth/callback?code=..., which the existingapp/auth/callback.tsxroute handles. Mobile path unchanged.Test plan
npx expo start --web→ tap "Sign up with LinkedIn" → tab navigates to backend → LinkedIn auth → returns to/auth/callback?code=...→ user lands on JoinEventPage authenticatednpx expo starton iOS → existing in-app browser flow still works end-to-endhttps://shatter-mobile.vercel.app/