supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
661 stars 154 forks source link

Current user is null while current session exists #871

Closed timlunar closed 3 months ago

timlunar commented 3 months ago

Describe the bug After restarting the app Supabase returns currentUser as null while the currentUser is valid and contains User object (with all user's metadata, accessToken, etc.).

To Reproduce Steps to reproduce the behavior:

  1. Login with valid credentials (Supabase function signInWithPassword)
  2. Close the app and wait for the token to expire
  3. Re-open the app
  4. Supabase currentUser is null but the currentSession is not null

Expected behavior Current user should display the same user value as inside the currentSession object.

Version (please complete the following information): On MacOS ├── supabase_flutter 2.0.2 │ ├── supabase 2.0.2 │ │ ├── functions_client 2.0.0 │ │ ├── gotrue 2.1.0 │ │ ├── postgrest 2.0.1 │ │ ├── realtime_client 2.0.0 │ │ ├── storage_client 2.0.0

Flutter doctor: [✓] Flutter (Channel stable, 3.19.2, on macOS 14.3.1 23D60 darwin-arm64, locale en-SI) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.2) [✓] Android Studio (version 2022.2) [✓] Android Studio (version 2023.1) [✓] Connected device (3 available)
[✓] Network resources

dshukertjr commented 3 months ago

This issue is fixed on the latest version. Please upgrade your supabase_flutter version and try it out.

timlunar commented 3 months ago

Perfect. It worked!

Thank you