Skip to content

Commit

Permalink
fix: employ EmailVerificationReact recipe on non-local env
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Sep 18, 2024
1 parent 12e095e commit 1809968
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/infrastructures/supertokens/frontendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { useRouter } from 'next/navigation';
import SuperTokensReact from 'supertokens-auth-react';
import type { SuperTokensConfig } from 'supertokens-auth-react/lib/build/types';
import EmailPasswordReact from 'supertokens-auth-react/recipe/emailpassword';
import EmailVerificationReact from 'supertokens-auth-react/recipe/emailverification';
import SessionReact from 'supertokens-auth-react/recipe/session';

import { appInfo } from './appInfo';
Expand All @@ -16,7 +17,13 @@ export function setRouter(router: ReturnType<typeof useRouter>, pathName: string
export const frontendConfig = (): SuperTokensConfig => {
return {
appInfo,
recipeList: [EmailPasswordReact.init(), SessionReact.init()],
recipeList: [
EmailPasswordReact.init(),
...(process.env.NEXT_PUBLIC_WB_VERSION === 'staging' || process.env.NEXT_PUBLIC_WB_VERSION === 'production'
? [EmailVerificationReact.init({ mode: 'REQUIRED' })]
: []),
SessionReact.init(),
],
windowHandler: (original) => ({
...original,
location: {
Expand Down

0 comments on commit 1809968

Please sign in to comment.