User profile information here
Enter the code sent to {userEmail}
{error &&Invalid email
} > ); } ``` -------------------------------- ### Get Safe Redirect Path - Failure Example Source: https://github.com/bytaesu/sb-kit/blob/main/_autodocs/api-reference/safe-redirect.md Illustrates a failed validation scenario where the redirect URL is deemed unsafe (e.g., invalid host or blocked path), returning the configured default path. Assumes a valid `config` object is provided. ```typescript const url = new URL('https://evil.com/steal', window.location.origin); getSafeRedirectPath(url, config); // Returns: '/' (or defaultPathAfterAuth from config) ``` -------------------------------- ### Usage Example in OAuth Callback Handler Source: https://github.com/bytaesu/sb-kit/blob/main/_autodocs/api-reference/safe-redirect.md Shows a practical implementation of getSafeRedirectPathFromParam within an OAuth callback handler. It demonstrates how to extract the redirect URL parameter, obtain the request origin, and use the function to get a safe redirect path before performing the redirection. ```typescript import { getSafeRedirectPathFromParam } from '@sb-kit/core'; // In OAuth callback handler async function callbackHandler(request: Request, sbKitConfig: SbKitConfig) { const url = new URL(request.url); const redirectUrlParam = url.searchParams.get('redirect_url'); const origin = getOrigin(request, url); // Safely parse and validate the redirect parameter const safePath = getSafeRedirectPathFromParam( redirectUrlParam, origin, sbKitConfig ); return NextResponse.redirect(new URL(safePath, origin)); } ``` -------------------------------- ### SetPassword Component Usage Example Source: https://github.com/bytaesu/sb-kit/blob/main/_autodocs/api-reference/auth-components.md Example of how to integrate the SetPassword component within an application page, utilizing AuthWrapper for context. ```typescript // app/set-password/page.tsx import { sbKit } from '@/lib/sb-kit'; export default function SetPasswordPage() { return (