Skip to content

Commit

Permalink
chore: test with dummy locals value
Browse files Browse the repository at this point in the history
  • Loading branch information
xynydev committed Apr 20, 2024
1 parent a0f4e34 commit 9f5d8b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ export const handle: Handle = async ({ event, resolve }) => {
event.locals.githubUser = null;
}

event.locals.hello = "world";

return resolve(event);
};
3 changes: 2 additions & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export async function load({ locals }) {
return {
githubUser: locals.githubUser
githubUser: locals.githubUser,
hello: locals.world
};
}
2 changes: 1 addition & 1 deletion src/routes/new/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { redirect } from "@sveltejs/kit";
export function load({ locals }) {
export async function load({ locals }) {
if (locals.githubUser === null) {
redirect(303, "/");
}
Expand Down

0 comments on commit 9f5d8b7

Please sign in to comment.