Closed TheOnlyTails closed 11 months ago
Hey, actually it can only be a string. This is the information that is coming out from the GoTrue server. If you use an older version of gotrue-js, but a newer version of gotrue (the server) you will not be able to recognize any new providers supported by the server. This is why it has to be a string.
Furthermore, SSO providers are not enumerable, i.e. the provider name is sso:<uuid>
as they're registered on the server. In that case you also can't use a const-style type.
I'll close this PR, though absolutely feel free to suggest changes whenever you see anything that can be improved. If you want to change something but are not sure, open an issue where you can discuss approaches with the team and community before spending time on it.
Alright, no problem! it only took me 2 minutes so I didn't waste too much time :sweat_smile:
What kind of change does this PR introduce?
This changes the type of the
provider
fields onUserAppMetadata
andUserIdentity
fromstring
toProvider
, which is the more accurate type.What is the current behavior?
Right now, the field is typed as
string
, which tells typescript it can be any string, when in fact it can only ever be one of the values ofProvider
.this is my first PR here, let me know of there's something I missed!