From c1cc6968d4fdee5e081ab9e0a9b6e20492c4b079 Mon Sep 17 00:00:00 2001 From: debie Date: Tue, 17 Oct 2023 14:14:02 -0700 Subject: [PATCH] Updated example to run with nextjs --- .../src/components/StytchOTP.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/demo-pkp-social-auth-next-ts/src/components/StytchOTP.tsx b/apps/demo-pkp-social-auth-next-ts/src/components/StytchOTP.tsx index d3f83099fc..6ede23b0a3 100644 --- a/apps/demo-pkp-social-auth-next-ts/src/components/StytchOTP.tsx +++ b/apps/demo-pkp-social-auth-next-ts/src/components/StytchOTP.tsx @@ -41,11 +41,14 @@ const StytchOTP = ({ authWithStytch, setView }: StytchOTPProps) => { setLoading(true); setError(undefined); try { - const response = await stytchClient.otps.authenticate(code, methodId, { - session_duration_minutes: 60, - }); + const response = await stytchClient.otps.authenticate( + code, + methodId, + { session_duration_minutes: 60 + }); await authWithStytch(response.session_jwt, response.user_id); } catch (err) { + console.log(err); setError(err); } finally { setLoading(false);