Skip to content

Commit

Permalink
Merge pull request #129 from LouisDeconinck/optional-profile
Browse files Browse the repository at this point in the history
Optional profile
  • Loading branch information
scosman authored Aug 29, 2024
2 parents b3d0f7b + 3bfa01b commit 43b7fec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export const WebsiteName: string = "SaaS Starter"
export const WebsiteBaseUrl: string = "https://saasstarter.work"
export const WebsiteDescription: string =
"Open source, fast, and free to host SaaS template. Built with SvelteKit, Supabase, Stripe, Tailwind, DaisyUI, and Postgres"
export const CreateProfileStep: boolean = true
4 changes: 3 additions & 1 deletion src/routes/(admin)/account/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import { createSupabaseLoadClient } from "@supabase/auth-helpers-sveltekit"
import type { Database } from "../../../DatabaseDefinitions.js"
import { redirect } from "@sveltejs/kit"
import { CreateProfileStep } from "../../../config"

export const load = async ({ fetch, data, depends, url }) => {
depends("supabase:auth")
Expand All @@ -29,7 +30,8 @@ export const load = async ({ fetch, data, depends, url }) => {
profile &&
!_hasFullProfile(profile) &&
url.pathname !== createProfilePath &&
url.pathname !== signOutPath
url.pathname !== signOutPath &&
CreateProfileStep
) {
redirect(303, createProfilePath)
}
Expand Down

0 comments on commit 43b7fec

Please sign in to comment.