supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
487 stars 121 forks source link

Hide sign up link #47

Closed cdedreuille closed 1 year ago

cdedreuille commented 1 year ago

It would be great to be able to hide the sign-up link. In our case, our app is closed in beta and we just don't want people to sign up.

kennethcassel commented 1 year ago

+1 on this, would be nice to be able to use this in a flow where someone has to first purchase a subscription / access before sign-up.

bobtechinsider commented 1 year ago

+1

silentworks commented 1 year ago

This is now possible with the latest release by passing a showLinks={false} prop to the component.

<Auth
  supabaseClient={supabase}
  view="sign_in"
  showLinks={false}
/>

This now means if you are using something like NextJS, you can just show the view of the component you wish on each page without worrying about the component using its internal state to change to the signup page. Do note however that this is just a visual change so if a user knows how to pass state into an component using the React dev tools for instance they could show the sign_up view by passing that to the view prop.

jtlapp commented 1 year ago

Never mind. Post deleted. I was passing sign_in for both pages. It's working now.

silentworks commented 1 year ago

@jtlapp you gave me a scare there as I just noticed the original message in my inbox. Thanks for coming back and stating what the issue was.

WesselKoorn commented 1 year ago

In my case I wanted to hide the signup link but didn't want to get rid of the magic and forgot password links. I solved it with custom styling:

<Auth
  supabaseClient={supabaseClient}
  providers={[]}
  magicLink={true}
  appearance={{
     theme: ThemeSupa,
     className: {
      anchor: styles.anchor,
     },
  }}
/>

Scss module:

.anchor {
  &:nth-child(3) {
    display: none;
  }
}