supabase / auth-js

An isomorphic Javascript library for Supabase Auth.
MIT License
356 stars 160 forks source link

fix: Type error on code exchange when no item in storage #825

Closed dshukertjr closed 9 months ago

dshukertjr commented 9 months ago

What kind of change does this PR introduce?

Currently when code exchange for pkce flow is triggered on device that didn't start the auth flow (e.g. signed up via magic link on laptop and clicked on the link on phone), TypeError: Cannot read properties of null (reading 'split') error is thrown. This PR fixes that.

Fixes the error pointed out here https://github.com/supabase/gotrue-js/pull/813#discussion_r1428876014