Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Add the ability to enable the shouldCreateUser on passwordless login#262

Open
albertocubeddu wants to merge 3 commits intosupabase-community:mainfrom
albertocubeddu:add-option-shouldcreate-user
Open

Add the ability to enable the shouldCreateUser on passwordless login#262
albertocubeddu wants to merge 3 commits intosupabase-community:mainfrom
albertocubeddu:add-option-shouldcreate-user

Conversation

@albertocubeddu
Copy link
Copy Markdown

What kind of change does this PR introduce?

  • Update the requirements to use the latest pnpm.
  • Ability to pass "additionalData" to the <MagicLink>.
  • Implement the logic for <MagicLink> when "additionalData" is provided (as it's optional).

What is the current behavior?

You're not able to provide any additional data, therefore you can't decide if you want to create users when a customer uses OTP.

What is the new behavior?

Passing the proper option, you'll be able to decide if you want to have shouldCreateUser

 <Auth
    supabaseClient={supabase}
    additionalData={{ shouldCreateUser: false }}
    view={view.id}

Furthermore, we're using the SignInWithPasswordlessCredentials and we are adding the ability to pass data too

const signInOptions: SignInWithPasswordlessCredentials = {
      email,
      options: {
        emailRedirectTo: redirectTo,
        data: restData,
        ...(shouldCreateUser !== undefined && { shouldCreateUser }),

Additional context

I've decided to re-use the additionalData, as it's used on another component, and it seems to continue with the logic of the original author.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant