Closed mb21 closed 7 months ago
Uhm... any chance this will be resolved at some point? Or are we better off using the REST API directly?
Or would a pull request fixing this be merged?
Is this an issue with the type definition, it seems like the data object exists on the second type with the phone number
| {
/** The user's email address. */
email: string
/** The user's password. */
password: string
options?: {
/** Verification token received when the user completes the captcha on the site. */
captchaToken?: string
}
}
| {
/** The user's phone number. */
phone: string
/** The user's password. */
password: string
options?: {
/**
* A custom data object to store the user's metadata. This maps to the `auth.users.user_metadata` column.
*
* The `data` should be a JSON object that includes user-specific info, such as their first and last name.
*/
data?: object
/** Verification token received when the user completes the captcha on the site. */
captchaToken?: string
}
}
@mb21 @JJAHMEDAMER apologies for the oversight, this is an issue with the type definition and i've just put up a PR to fix this: https://github.com/supabase/gotrue-js/pull/848
@kangmingtay thanks for taking a look at this! My preferred outcome would of course have been that the data is written to user_metadata
, not that the type definition is removed. Would this be considered a feature request? Would it be merged if I made a PR?
@kangmingtay and @hf you're working for supabase, right? Could you please answer my question(s) about whether a PR would be accepted to save signInWithPassword
's options.data
argument to user_metadata
? Or should I open a new issue with this feature request?
@mb21 Hi, may you share your solution? Anyway.. they removed the option to pass data when you sign in.. so i think we need to use a procedure/function in order to sign in..
@Giasinit I haven't actually coded anything and am not going to unless somebody from supabase gives an indication that it might be merged. But as unresponsive as they have been it's unclear to me whether supabase auth is actively developed. Therefore we're looking to switch to https://lucia-auth.com
Describe the bug
signInWithPassword ignores the
options.data
field, even though the TypeScript definitions list options.data as a supported field – at least in the case where you provide a phone number.To Reproduce
Call
supabase.auth.signInWithPassword({ phone, password, options: { data } })
.Expected behavior
options.data
should be persisted inauth.users.user_metadata
.Ideally, this should also work for the case where you provide
email
instead ofphone
.System information
Additional context
Related question: https://github.com/orgs/supabase/discussions/8873