Auth layer calls /auth/login and /auth/refresh-token - #9
Merged
P3az3 merged 2 commits intoAug 24, 2026
Merged
Conversation
Auth layer calls /auth/login and /auth/refresh-token
5 tasks
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.
PR Description — Align Frontend Authentication with Backend Wallet Challenge-Response
Summary
This PR replaces the frontend's unsupported email/password and refresh-token authentication flow with the wallet-based challenge-response authentication implemented by the backend.
The current frontend calls
/auth/login,/auth/register,/auth/refresh-token, and other endpoints that do not exist in the backend. As a result, users cannot authenticate against the actual API, and session renewal is built around a nonexistent refresh-token flow.This change aligns the frontend authentication layer with the backend's existing
/auth/challengeand/auth/verifyendpoints.Changes
Replaced the unsupported
/auth/loginflow with wallet challenge-response authentication.Added frontend support for:
GET /auth/challengePOST /auth/verifySign the backend-provided challenge using the connected Stellar wallet.
Send
walletAddress,signedChallenge, andchallengeto/auth/verify.Store and use the returned
accessTokenas the Bearer token for authenticated API requests.Removed/replaced calls to unsupported:
/auth/login/auth/register/auth/refresh-token/auth/social-login/auth/meReworked session expiry handling to trigger wallet re-authentication instead of attempting to refresh a nonexistent token.
Updated authentication state management to work with the backend's wallet-based identity.
Updated API types to match the backend response:
accessTokentokenTypeKept the existing OAuth/NextAuth flow separate since social authentication is outside the scope of this fix.
Testing
Added/updated coverage for:
/auth/verify.Validation
Run:
Expected Outcome
The frontend and backend now use the same authentication contract.
A user can connect their Stellar wallet, sign the backend challenge, receive a valid access token, and use that token for protected API requests. When the token expires, the application prompts the user to authenticate again through the wallet rather than attempting to call the nonexistent
/auth/refresh-tokenendpoint.This removes the two incompatible authentication models and establishes the backend's wallet challenge-response flow as the working frontend authentication path.
Closes #5