Jeff Durrant
03/11/2026, 10:33 PMDevRev
03/11/2026, 10:33 PM// When redirecting to Descope, include your deep link as a parameter
const originalDeepLink = '<myapp://product/123>';
const descopeAuthUrl = `<https://auth.descope.com/flow?flowId=your-flow&redirect_uri=${encodeURIComponent('https://yourapp.com/callback')}&state=${encodeURIComponent(originalDeepLink)}`;>
// Redirect user to Descope
window.location.href = descopeAuthUrl;
Callback Handling
// In your callback handler (/callback route)
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
const originalDeepLink = urlParams.get('state');
// Exchange code for tokens, then redirect to original deep link
if (code && originalDeepLink) {
// Complete authentication
await exchangeCodeForTokens(code);
// Redirect to original deep link
window.location.href = decodeURIComponent(originalDeepLink);
}
• The state parameter preserves your original deep link URL through the authentication flow
• After successful authentication, Descope redirects to your specified redirect_uri with the authorization code
• For mobile apps, configure app links to handle the deep link redirects properly
Use Descope With FlutterFlow | Descope Documentation
Create Redirect URI for Sign-In Request | API Reference | Descope Documentation
React Native Quickstart | Descope Documentation