PROBLEM: when defining custom metadata in SupabaseUserGlobalContext -> Signup method, the current method requires a user to specify an options object as per the supabase docs
While this works, it requires the user to go and reference the supabase JS docs, which doesn't match the ethos of low-code that this library is trying to achieve.
SOLUTION from @RyanMouritz
//sign up function
//signUp
signup: async (email: string, password: string, successRedirect: string, emailRedirect?: string, userMetadata?: UserMetadata) => {
try {
const supabase = await createClient();
let options = Object.assign({},
userMetadata && { data: userMetadata },
emailRedirect && { emailRedirectTo: emailRedirect },
)
const { error } = await supabase.auth.signUp({
email,
password,
options
});
if (error) throw error;
await getUserAndSaveToState();
setError(null);
//Redirect if needed
if((successRedirect) && router) router.push(successRedirect);
// There is potential to include a signup redirect here that would redirect to a page provided in an action parameter
return true;
} catch (e) {
setError(getErrMsg(e))
return false;
}
},
PROBLEM: when defining custom metadata in SupabaseUserGlobalContext -> Signup method, the current method requires a user to specify an options object as per the supabase docs
While this works, it requires the user to go and reference the supabase JS docs, which doesn't match the ethos of low-code that this library is trying to achieve.
SOLUTION from @RyanMouritz
And registration