supabase-community / flutter-auth-ui

Supabase Auth UI library for Flutter
https://supabase.com
MIT License
115 stars 60 forks source link

Add anonymous sign in support #91

Closed FatumaA closed 5 months ago

FatumaA commented 6 months ago

Feature request

Is your feature request related to a problem? Please describe.

Feels right to add anon sign in support

Describe the solution you'd like

Have anon sign in available in this library

Additional context

Supabase GA week launch feature: https://supabase.com/docs/guides/auth/auth-anonymous

FatumaA commented 6 months ago

Hi @dshukertjr 👋🏼,

First I thought this lib could do without it but gave it some thought and perhaps we do need it.

If you agree, I'll start on it

FatumaA commented 6 months ago

Hi @dshukertjr 👋🏼,

First I thought this lib could do without it but gave it some thought and perhaps we do need it.

If you agree, I'll start on it

Actually there is nothing to do here as anon sign in does not need a ui and can be accessed already via the library supabase.auth.signInAnonymously();

bcorman commented 5 months ago

Hi @dshukertjr 👋🏼, First I thought this lib could do without it but gave it some thought and perhaps we do need it. If you agree, I'll start on it

Actually there is nothing to do here as anon sign in does not need a ui and can be accessed already via the library supabase.auth.signInAnonymously();

What about support for converting an anonymous user to a regular one? It would still be necessary to collect an email/username and password, and then link the identity, e.g. await supabase.auth.updateUser(UserAttributes(email: 'example@email.com')); .

Currently, signing up a new user who is already logged in anonymously will result in two separate accounts. This could be handled in supabase by passing metadata on account creation like anonymousUserId and then merging the two accounts with some database function, but it would be so much easier to just call updateUser from the client.

FatumaA commented 5 months ago

Hi @dshukertjr 👋🏼, First I thought this lib could do without it but gave it some thought and perhaps we do need it. If you agree, I'll start on it

Actually there is nothing to do here as anon sign in does not need a ui and can be accessed already via the library supabase.auth.signInAnonymously();

What about support for converting an anonymous user to a regular one? It would still be necessary to collect an email/username and password, and then link the identity, e.g. await supabase.auth.updateUser(UserAttributes(email: 'example@email.com'));.

Currently, signing up a new user who is already logged in anonymously will result in two separate accounts. This could be handled in supabase by passing metadata on account creation like anonymousUserId and then merging the two accounts with some database function, but it would be so much easier to just call updateUser from the client.

Hi, Thank you for this. I will take a look at it.

Also, will add a "continue as guest" button for anon sign ups to let user know explicitly that there being signed in

dshukertjr commented 5 months ago

Also, will add a "continue as guest" button for anon sign ups to let user know explicitly that there being signed in

I'm against adding this button as the point of anonymous sign-in is to sign the user in without the users knowing it.

FatumaA commented 5 months ago

Also, will add a "continue as guest" button for anon sign ups to let user know explicitly that there being signed in

I'm against adding this button as the point of anonymous sign-in is to sign the user in without the users knowing it.

I was thinking to have it as an option just for increased transparency where it is necessary. Either way should be fine because the developer can add a notification or banner that alerts the user they are in guest mode