React SPA Example¶
Reference implementation for client-side authorize redirect with backend token exchange.
Install¶
Issuer¶
Use https://auth.last1.id. client_id is Copy Client ID (UUID) or the App ID slug.
Recommended architecture¶
- Frontend:
Last1LoginButtonfor redirect.- Store PKCE verifier in session storage.
- Backend:
- Exchange code using
exchangeCode()with client secret. - Return app session token to SPA.
Security note¶
Do not ship client secret in browser bundles. Public SPA should perform token exchange through backend.