Login configuration (must match what was used in loginWithRedirect)
Promise resolving to token response, or undefined if not a valid callback
// In your callback page
import { handleLoginCallback } from '@imtbl/auth';
const tokens = await handleLoginCallback({
clientId: 'your-client-id',
redirectUri: 'https://your-app.com/callback',
});
if (tokens) {
// Login successful, tokens contains accessToken, refreshToken, etc.
await signIn('immutable', { tokens: JSON.stringify(tokens) });
}
Handle the OAuth callback after redirect-based login. Extracts the authorization code from the URL and exchanges it for tokens.