Commit d7704b7
authored
feat(auth): support multiple Google OAuth callback URLs for web + mobile (#134)
* feat(auth): support multiple Google OAuth callback URLs for web + mobile
- Add OAUTH_GOOGLE_CALLBACK_URLS (comma-separated) with backward compat for OAUTH_GOOGLE_CALLBACK_URL
- Client sends redirect_uri in authorize-url request; server validates against allowlist
- Store redirectUri in verification meta for exchange step
- useOAuthLogin/useOAuthLink accept optional redirectUri for Google (mobile custom schemes)
- Update providers and auth docs
* docs: update auth and deployment for Google OAuth multi-URL callback
- authentication.mdx: add Google redirect endpoints, link-authorize-url with redirect_uri, callback pages
- account-linking.mdx: document meta.redirectUri and Google multi-URL flow
- vercel.mdx: add OAuth env vars pointer to Authentication doc
* fix(auth): add Google OAuth PKCE, token sync, and UI fixes
* fix(auth): refactor Google exchange, handleGoogleClick, Google error mappings
* fix(fastify,next): address inline review findings
- Revert max-lines to 300, extract exchange/template helpers
- Remove oauth_not_configured toast, use oauth_failed_google for Google callback
- Fix no-throw-literal in oauth-google
* fix(auth): validate OAuth redirect URI and improve Google error mapping
- Re-validate redirectUri from state against allowedUrls in Google exchange
- Add googleOverrides map and google_email_required message
- Refactor translateOAuthError: resolve base key then apply provider overrides
* fix(fastify): harden Google OAuth exchange and error handling
- add isLinkMode/linkUserId guard to fail closed on invalid link state
- preserve refresh token when Google omits it on existing accounts
- pass through upstream HTTP status (401/429/5xx) in token/user catch blocks
- add 429 to exchange response schema for rate limits1 parent f96b173 commit d7704b7
File tree
38 files changed
+1942
-378
lines changed- apps
- docu/content/docs
- architecture
- deployment
- fastify
- openapi
- src
- db/schema/tables
- lib
- routes
- auth
- oauth
- google
- reference
- next
- app
- (dashboard)/settings/(profile)
- auth
- callback/oauth/google
- login
- lib/auth
- packages
- core/src
- gen
- react/src/hooks
38 files changed
+1942
-378
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
309 | 312 | | |
310 | 313 | | |
311 | 314 | | |
| |||
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | | - | |
| 330 | + | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
| |||
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
361 | | - | |
| 364 | + | |
362 | 365 | | |
363 | 366 | | |
364 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 14 | | |
0 commit comments