Skip to content

Commit

Permalink
Updated example to run with nextjs
Browse files Browse the repository at this point in the history
  • Loading branch information
debbly committed Oct 17, 2023
1 parent 9e5aa6d commit c1cc696
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1cc696

Please sign in to comment.