Skip to content

fix firebase cookie issue #500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions apps/codingcatdev/src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import { preview } from '$lib/server/content';

//export const prerender = false;
export const load = async ({ cookies }: { cookies: Cookies }) => {
// Get latest podcast
const podcasts = (
await listContent<Content>({
contentItems: await getContentTypeDirectory<Content>(ContentType.podcast),
limit: 5
})
).content;
try {
// Get latest podcast
const podcasts = (
await listContent<Content>({
contentItems: await getContentTypeDirectory<Content>(ContentType.podcast),
limit: 5
})
).content;

const ccdsession = cookies.get('session');
if (!ccdsession) {
return {
Expand All @@ -39,6 +38,9 @@ export const load = async ({ cookies }: { cookies: Cookies }) => {
cookies.set('session', '', { expires: new Date(0) });

console.error(error);
return { preview };
return {
podcasts,
preview
};
}
};