-
Notifications
You must be signed in to change notification settings - Fork 38
feat(auth): migrate to Better Auth + OAuth 2.1 for MCP #2373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
d2b8ed0
feat(auth): migrate to Better Auth + OAuth 2.1 for MCP
andrew-bierman 8e6cf90
fix(auth): replace raw typeof checks with @packrat/guards
andrew-bierman 561b40c
fix(mcp): replace raw regex literals with magic-regexp + fix TS casts
andrew-bierman 22e392c
chore(deps): move magic-regexp to workspace catalog
andrew-bierman 6dafda0
fix(api): restore isAuthenticated on alltrails preview route
andrew-bierman d7c5a45
chore: sort apps/expo/package.json keys
andrew-bierman ef16d99
fix(casts): add safe-cast annotations to pass strict cast checker
andrew-bierman 9debcc5
chore: update bun.lock after adding magic-regexp
andrew-bierman e891d57
docs: mark better-auth migration plan as completed
andrew-bierman 6395c2e
refactor(auth): remove legacy JWT/token utilities and empty auth routes
andrew-bierman eb0bf68
test(auth): add comprehensive Better Auth integration tests
andrew-bierman 9c4fe24
chore: remove stale nativewindui@1.1.0 patch
andrew-bierman d385b45
fix(db): split UUID+Better Auth migration into 6 working parts
mikib0 23f7ed0
fix(db): handle social feed tables in UUID migration 0045
mikib0 40b14f9
chore: update lockfile
mikib0 d7a4ef2
chore(api/auth): add static auth.config.ts stub for Better Auth CLI i…
mikib0 7409b3a
fix(api/db): add missing required better-auth fields
mikib0 02b9610
fix(api/better-auth): add missing jwks table to adapter schema config…
mikib0 d40e856
fix(api/auth): handle pre-migration bcrypt password hashes in Better …
mikib0 2352804
chore(api/tests): fix failing API tests caused by a missing `name` field
mikib0 0fd4bdf
fix(api/schemas): update userId and timestamp field types after UUID …
mikib0 8b9732e
fix(expo/auth): avoid logout on network failure
mikib0 e6c62ed
fix(api/auth): add expo server plugin to fix sign-out 403
mikib0 ce8d0f0
fix(expo/auth): annotate safe-casts to pass pre-push strict check
mikib0 d92d7c3
chore(expo): add expo-network dependency
mikib0 e2f1b8f
Merge remote-tracking branch 'origin/development' into feat/better-au…
mikib0 490b9a0
fix(api/db): make uuid migration resilient to missing social feed tables
mikib0 a9e92f2
fix(expo/auth): restore guest mode and reactive isAuthed sync
mikib0 bcb4221
fix(expo/auth): post-sign-out prompt, clear RQ cache, fix sign-in hang
mikib0 8108a15
fix(api/auth): register Apple provider for native id-token flow
mikib0 da32d86
fix(lint): resolve biome warnings for code quality
Copilot 18566c5
fix(api): remove deleted/lastActiveAt fields from users table after B…
Copilot d9357df
fix(lint): remove unused variables and imports after Better Auth migr…
Copilot ce0496e
fix(types): remove lastActiveAt/deletedAt references and fix user id …
Copilot c557aeb
merge: resolve conflicts with development
andrew-bierman 8ed5595
fix(merge): repair post-merge type breakage from development conflicts
andrew-bierman 0605558
chore(merge): reconcile bun.lock with deps from development merge
andrew-bierman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,8 @@ | ||
| import kvStorage from 'expo-app/lib/kvStorage'; | ||
| import { atom } from 'jotai'; | ||
| import { atomWithStorage } from 'jotai/utils'; | ||
|
|
||
| // User type definition | ||
| export type User = { | ||
| id: number; | ||
| email: string; | ||
| firstName?: string; | ||
| lastName?: string; | ||
| emailVerified: boolean; | ||
| }; | ||
|
|
||
| // Token storage atom | ||
| export const tokenAtom = atomWithStorage<string | null>('access_token', null, kvStorage); | ||
|
|
||
| export const refreshTokenAtom = atomWithStorage<string | null>('refresh_token', null, kvStorage); | ||
|
|
||
| // Loading state atom | ||
| export const isLoadingAtom = atom(false); | ||
|
|
||
| export const redirectToAtom = atom<string>('/'); | ||
|
|
||
| // Re-authentication state | ||
| export const needsReauthAtom = atom(false); | ||
| // Prevents AppLayout's useEffect from auto-navigating to /auth during the | ||
| // sign-out flow so the profile screen can show a post-sign-out prompt first. | ||
| export const suppressSignOutNavAtom = atom(false); |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't send
Authorization: Bearer null.When the session is still loading or the user is signed out, this builds a bogus bearer credential for every remote chat request. Omit the header until a real token exists.
Suggested fix
Also applies to: 136-138
🤖 Prompt for AI Agents