Skip to content

Commit

Permalink
10007: Fixing ttl check in get account confirmation code
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelschneiderman committed Mar 11, 2024
1 parent f154be0 commit dbe2c5b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const getAccountConfirmationCode = async (
});

const now = Number(formatNow(FORMATS.UNIX_TIMESTAMP_SECONDS));
if (result.ttl && result.ttl > now) {
return result?.confirmationCode;

if (!result || (result.ttl && result.ttl < now)) {
return undefined;
}

return result.confirmationCode;
};

0 comments on commit dbe2c5b

Please sign in to comment.