Search code examples
fluttersupabasesupabase-databasesupabase-flutter

How to add username in supabase.auth.currentUser?


If already authenticated, i can access and call supabase.auth.currentUser to retrieve some user data like full_name, email, avatar_url, etc.

But how to modify the data inside it?, so when i login and authenticated, i can call supabase.auth.currentUser that contains my username.


Solution

  • Maybe there is a way by modify postgresql in supabase, but i'm beginner that don't know about it.

    In here i take an example data of 'username'. If i logged in, i can call supabase.auth.currentUser where saved in cache automatically. But by default there isn't username data in there.

    What do i do, after login is success, i directly request again to get username data and save it in local storage using shared_preferences plugin. Then navigate to home page.