-
Notifications
You must be signed in to change notification settings - Fork 485
refactor: create a new type to avoid repeat ourselves and add the correct return type for createClient method #258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rect return type for createClient method
Wouldn't |
You're totally right, they both do the same, it's just a matter of custom for those who have been using TS since before version 2.1 (which is when the records arrived) 🐶 About being easier to read, to me they both seem simple (again, seems like a particular preference) |
Co-authored-by: Wen Bo Xie <5532241+w3b6x9@users.noreply.github.com>
@w3b6x9 First and last time I try to resolve conflict by browser (using the mobile) hahaha |
haha wow mobile browser...that's quite the challenge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks!
## What kind of change does this PR introduce? * Supercedes #258 * Adds `reauthenticate()` method to allow a user to request for a nonce to subsequently update their password * Updates the type for `UserAttributes` which is used in `updateUser()` to include the `nonce` * If a nonce is not passed into `updateUser()`, an `AuthSessionMissingError()` will be returned ## Details With this addition, the update password flow will look like the following when "Secure password change" is enabled on the Supabase dashboard. For users that are self-hosting gotrue and using gotrue-js, this requires setting the environmentr variable, `GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_REAUTHENTICATION="true"` ``` // Send reauthentication to the current user. User must be signed-in to perform this action. await supabase.auth.reauthenticate() // Update password await supabase.auth.updateUser({ password: "new-pasword", "nonce": "123456" } ```
What kind of change does this PR introduce?
Refactor our codebase creating a new type to avoid repeat ourselves and add the correct return type for createClient method