Repository navigation
feat(auth): add mobile JWT auth, member-scoped /v1 access and /v1/me endpoints - #1621
Merged
Merged
Conversation
realcodesiman
force-pushed
the
feat/mobile-jwt-auth
branch
from
November 3, 2026 05:43
cbc04fa to
7d1527c
Compare
…endpoints Native mobile app grants (password, exchange_code, refresh_token) via a better-auth plugin: short-lived access JWT (audience <builder>/api) signed by the existing jwt() plugin, opaque rotating refresh tokens stored hashed in the new MobileRefreshToken table (reuse revokes the family), social-login relay callback and revoke. workspaceTokenAuthMidddleware gains a third branch for mobile JWTs that authenticates the caller as a workspace member. Member principals can reach only an allowlist of /v1 routes and those routes apply the same contact and conversation scoping the web app applies; workspace tokens and MCP OAuth are unchanged. Adds /v1/me, /v1/me/workspaces, /v1/me/device-tokens, /v1/me/password and /v1/realtime/connect-token, and an enableInInbox field and filter on flows.list.
realcodesiman
force-pushed
the
feat/mobile-jwt-auth
branch
from
November 4, 2026 02:36
c56b962 to
c86d4c6
Compare
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…endpoints (#1621) * feat(auth): add mobile JWT auth, member-scoped /v1 access and /v1/me endpoints Native mobile app grants (password, exchange_code, refresh_token) via a better-auth plugin: short-lived access JWT (audience <builder>/api) signed by the existing jwt() plugin, opaque rotating refresh tokens stored hashed in the new MobileRefreshToken table (reuse revokes the family), social-login relay callback and revoke. workspaceTokenAuthMidddleware gains a third branch for mobile JWTs that authenticates the caller as a workspace member. Member principals can reach only an allowlist of /v1 routes and those routes apply the same contact and conversation scoping the web app applies; workspace tokens and MCP OAuth are unchanged. Adds /v1/me, /v1/me/workspaces, /v1/me/device-tokens, /v1/me/password and /v1/realtime/connect-token, and an enableInInbox field and filter on flows.list. * refactor(auth): centralize mobile resource authorization * fix(auth): harden mobile jwt authorization * fix(auth): serialize mobile refresh token families * fix(auth): defer auth module loading in mobile edge paths
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
Verification