Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

"Current session is missing data" when restoring a phone user #29

Closed
chimon2000 opened this issue Aug 10, 2021 · 10 comments · Fixed by #55
Closed

"Current session is missing data" when restoring a phone user #29

chimon2000 opened this issue Aug 10, 2021 · 10 comments · Fixed by #55
Labels
bug Something isn't working

Comments

@chimon2000
Copy link

Bug report

Describe the bug

When attempting to restore the session, the user object is is returning null which causes the session to not be loaded.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Log in with a phone number user, using verifyOTP
  2. Refresh the screen
  3. Error should be printed when referencing recoverSession directly

Expected behavior

The user information should be returned when a user has successfully logged in using an SMS token. I noticed that this is not the case, when trying to print out the user info after a login, but I ignored it.

Screenshots

n/a

System information

  • OS: Linux
  • Browser (if applies): Chrome
    • Version of supabase: 0.1.0

Additional context

n/a

@chimon2000 chimon2000 added the bug Something isn't working label Aug 10, 2021
@bdlukaa
Copy link
Contributor

bdlukaa commented Aug 10, 2021

Can you try to call SupabaseAuth.instance.auth.user?

@dshukertjr
Copy link
Member

Thank you @chimon2000 for reporting this issue.

This bug seems to be related to supabase/auth#141, where upon verifying via OTP, user object is not being returned from the server.

@chimon2000
Copy link
Author

chimon2000 commented Aug 10, 2021

Can you try to call SupabaseAuth.instance.auth.user?

When attempting to reference the user value either from the auth instance or the session it was coming back as null.

@bdlukaa

@dshukertjr
Copy link
Member

@chimon2000
Yeah, this is not a bug on the client side, but on the server side. Unfortunately at the moment, it looks like we would have to wait for the issue on the server side to get resolved.

@neerajdana996
Copy link

any update on this ??

@dshukertjr
Copy link
Member

@Neerajdana
This issue is cause by supabase/auth#141 so unfortunately no updates at the moment.

@bdlukaa
Copy link
Contributor

bdlukaa commented Dec 5, 2021

@MisterJimson
Copy link
Contributor

So based on the last comment linked above, should the Supabase clients internally call GET /user in verifyOTP so the users of the client libraries don't need to work around the issue?

@bdlukaa
Copy link
Contributor

bdlukaa commented Feb 7, 2022

According to supabase/auth#141 (comment), #53 should fix this issue, no?


Edit: actually no. This issue is being caused because we check if the user is not null.

https://github.com/supabase-community/gotrue-dart/blob/main/lib/src/gotrue_client.dart#L315-L320

The same seems to happen in the js equivalent package:

https://github.com/supabase/gotrue-js/blob/master/src/GoTrueClient.ts#L635-L638

@bdlukaa
Copy link
Contributor

bdlukaa commented Mar 1, 2022

It looks like this is back on the latest master:

I/flutter ( 9428): ***** Supabase init completed Instance of 'Supabase'
I/flutter ( 9428): Current session is missing data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants