sinProject-Inc/talk

View on GitHub
src/routes/(authed)/+layout.server.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { base } from '$app/paths'
import { redirect } from '@sveltejs/kit'
import type { LayoutServerLoad } from './$types'

export const load: LayoutServerLoad = ({ locals, url }) => {
    if (!locals.user) {
        throw redirect(303, `${base}/sign-in?redirect_url=${url.pathname}`)
    }
}