Customizing Authentication
The authentication setup in SvelteBolt is highly customizable to fit your app's specific requirements.
Adding Social Providers
- Go to the Supabase Dashboard.
- Navigate to Authentication > Providers.
- Enable the desired provider and configure its credentials.
Extending User Profiles
Add additional fields to the profiles
table:
ALTER TABLE public.profiles ADD COLUMN location text;
Update the create_profile
function to handle new fields:
NEW.raw_user_meta_data ->> 'location'
Custom Redirect URLs
Update redirect URLs for login or signup flows in src/routes/+page.server.ts
:
const { data, error } = await supabase.auth.signInWithOtp({
email,
options: {
redirectTo: "https://your-app.com/dashboard",
},
});