Skip to content

Commit

Permalink
Don't recall safeGetSession, already in the hook
Browse files Browse the repository at this point in the history
  • Loading branch information
scosman committed Aug 31, 2024
1 parent a1a7ba5 commit 3d0cf79
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/routes/(marketing)/login/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import { redirect } from "@sveltejs/kit"
import type { LayoutServerLoad } from "./$types"

export const load: LayoutServerLoad = async ({
url,
locals: { safeGetSession },
locals: { session },
cookies,
url,
}) => {
// if the user is already logged in return them to the account page
const { session } = await safeGetSession()
if (session) {
redirect(303, "/account")
}
Expand Down

0 comments on commit 3d0cf79

Please sign in to comment.