Configuration
Learn how authentication works in MakerKit and how to configure it.
<article><p>The way you want your users to authenticate can be driven via configuration.</p><p>If you open the global configuration at <code>src/configuration.ts</code>, you'll find the <code>auth</code> object:</p><pre data-language="tsx">import type { Provider } from '@supabase/gotrue-js/src/lib/types';
auth: {
requireEmailConfirmation: false,
providers: {
emailPassword: true,
phoneNumber: false,
emailLink: false,
oAuth: ['google'] as Provider[],
},
}
</pre><p>As you can see, the <code>providers</code> object can be configured to only display the auth methods we want to use.</p><ol><li>For example, by setting both <code>phoneNumber</code> and <code>emailLink</code> to <code>true</code>, the authentication pages will display the <code>Email Link</code> authentication and the <code>Phone Number</code> authentication forms.</li><li>Instead, by setting <code>emailPassword</code> to <code>false</code>, we will remove the <code>email/password</code> form from the authentication and user profile pages.</li></ol><h2>Requiring Email Verification</h2><p>This setting needs to match what you have set up in Supabase. If you require email confirmation before your users can sign in, you will have to flip the following flag in your configuration:</p><pre data-language="ts">auth: {
requireEmailConfirmation: false,
}
</pre><p>When the flag is set to <code>true</code>, the user will not be redirected to the onboarding flow, but will instead see a successful alert asking them to confirm their email. After confirmation, they will be able to sign in.</p><p>When the flag is set to <code>false</code>, the application will redirect them directly to the onboarding flow.</p><h2>Emails sent by Supabase</h2><p>Supabase spins up an <a href="http://localhost:54324/">InBucket</a> instance where all the emails are sent: this is where you can find emails related to password reset, sign-in links, and email verifications.</p><p>To access the InBucket instance, you can go to the following URL: <a href="http://localhost:54324/">http://localhost:54324/</a>. Save this URL, you will use it very often.</p></article>