From e72d16164b11156b20cea619d71e6242f49cebe2 Mon Sep 17 00:00:00 2001 From: Chris <91094210+chris-stytch@users.noreply.github.com> Date: Wed, 19 Apr 2023 10:32:38 -0700 Subject: [PATCH] Email OTP and password example --- components/Passwords/LoginWithPasswords.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Passwords/LoginWithPasswords.tsx b/components/Passwords/LoginWithPasswords.tsx index c2d12aa..dcdde6b 100644 --- a/components/Passwords/LoginWithPasswords.tsx +++ b/components/Passwords/LoginWithPasswords.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Products, StytchEvent, StytchError, StytchLoginConfig } from '@stytch/vanilla-js'; +import { Products, StytchEvent, StytchError, StytchLoginConfig, OTPMethods } from '@stytch/vanilla-js'; import { useStytchUser, StytchLogin } from '@stytch/nextjs'; import { useRouter } from 'next/router'; import { getDomainFromWindow } from '../../lib/urlUtils'; @@ -11,10 +11,16 @@ const loginConfig: StytchLoginConfig = { resetPasswordExpirationMinutes: 30, resetPasswordRedirectURL: getDomainFromWindow() + '/recipes/passwords/reset', }, + otpOptions: { + methods: [ + OTPMethods.Email + ], + expirationMinutes: 5 + }, sessionOptions: { sessionDurationMinutes: 60 * 24, }, - products: [Products.passwords], + products: [Products.passwords, Products.otp], }; const callbackConfig = {