Open JuanxCursed opened 3 months ago
Same bug here, I got this error message:
AuthApiError: invalid request: both auth code and code verifier should be non-empty
at handleError (/Users/.../node_modules/@supabase/auth-js/dist/main/lib/fetch.js:63:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async _handleRequest (/Users/.../node_modules/@supabase/auth-js/dist/main/lib/fetch.js:111:9)
at async _request (/Users/.../node_modules/@supabase/auth-js/dist/main/lib/fetch.js:89:18)
at async SupabaseAuthClient._exchangeCodeForSession (/Users/.../node_modules/@supabase/auth-js/dist/main/GoTrueClient.js:409:33)
at async /Users.../node_modules/@supabase/auth-js/dist/main/GoTrueClient.js:736:28 {
__isAuthError: true,
status: 400,
code: undefined
Bug report
Describe the bug
I was trying to work on a more detailed workflow when recovering the password, and when I was taking a look at the source code, I've found a possible bug
When the recovery token is recorded into the storage, the key stored is
sb-api-auth-token-code-verifier
but when the code tries toexchangeCodeForSession
at line 545,${this.storageKey}-code-verifier
. this.storageKey is a constant set into theconstants.ts
namedSTORAGE_KEY
and its value issupabase.auth.token
Due to this, when
exchangeCodeForSession
is executed, since it doesn't find thecode-verifier
, I receive this error:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
exchangeCodeForSession
with this valueExpected behavior
Recover the session to reset the password properly
System information