Delete Verification value function

In state.ts in the better auth source code located at src/oauth2, in the parseState function if the verification value is expired, then it throws a "please_restart_the_process". but does not delete the verification value from the db as the delete verification db call is after the throw error statement which stops function execution.
if (parsedData.expiresAt < Date.now()) {
throw c.redirect(
`${c.context.baseURL}/error?error=please_restart_the_process`,
);
}
await c.context.internalAdapter.deleteVerificationValue(data.id);
if (parsedData.expiresAt < Date.now()) {
throw c.redirect(
`${c.context.baseURL}/error?error=please_restart_the_process`,
);
}
await c.context.internalAdapter.deleteVerificationValue(data.id);
Is this expected behaviour where the verification value is auto deleted afterwards if so how?
Solution:
fixed in 1.2.4-beta.6
Jump to solution
1 Reply
Solution
Netrifier
Netrifier2w ago
fixed in 1.2.4-beta.6

Did you find this page helpful?