Skip to content

Commit

Permalink
fix: show alert only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyArt1 committed Nov 21, 2023
1 parent 052ee14 commit c2658bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/[lang]/verification/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function Form({ flow, returnTo, code }: Props) {
const validFromQuery = code?.length === 6 && parseOTP(code).length === 6;

if (validFromQuery) setOtp(parseOTP(code));
else {
else if (code) {
AlertWarning(intl.errors.code.badUrl);
}

Expand Down Expand Up @@ -148,8 +148,8 @@ export function Form({ flow, returnTo, code }: Props) {
return;
case 410:
const newFlowID = err.response.data.use_flow_id;
// On submission, add the flow ID to the URL but do not navigate. This prevents the user loosing
// their data when they reload the page.
// On submission, add the flow ID to the URL but do not navigate.
// This prevents the user loosing their data when they reload the page.
router.push(`/verification?flow=${newFlowID}`);

ory
Expand Down

0 comments on commit c2658bd

Please sign in to comment.