Thrown when mfa.challengeWithPopup is called outside of a browser context (e.g., in a Server Component, Route Handler, or middleware).
challengeWithPopup() requires window and can only run in client components.
challengeWithPopup()
window
import { ExecutionContextError } from '@auth0/nextjs-auth0/errors';try { await mfa.challengeWithPopup({ audience: 'https://api.example.com' });} catch (err) { if (err instanceof ExecutionContextError) { // This method must be called from a client component }} Copy
import { ExecutionContextError } from '@auth0/nextjs-auth0/errors';try { await mfa.challengeWithPopup({ audience: 'https://api.example.com' });} catch (err) { if (err instanceof ExecutionContextError) { // This method must be called from a client component }}
Optional
Thrown when mfa.challengeWithPopup is called outside of a browser context (e.g., in a Server Component, Route Handler, or middleware).
challengeWithPopup()requireswindowand can only run in client components.Example