How do I login via token with supabase v2 auth?

In react native, I need to login via redirect and with a token.

  Linking.addEventListener('url', event => {
    let urlString = event.url.replace('app#', 'app?');
    let url = new URL(urlString);
    console.log({url});
    let refreshToken = url.searchParams.get('refresh_token');
    console.log({refreshToken});
    if (refreshToken) {
      supabase.auth.getUser(refreshToken).then(res => {
        setCurrentUser(res.data.user);
      });
    }
  });


I don't think getUser is the right thing to be using here? This is using the Google provider btw.

It worked using 1.5 but auth has obviously changed and the docs aren't completed yet.
Was this page helpful?