chore: update posthug and change all 301 to 307
This commit is contained in:
@@ -3,10 +3,9 @@ import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const load = ({ request }) => {
|
||||
client.capture({
|
||||
distinctId:
|
||||
request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'cal.com page visited',
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'cal.com page visited'
|
||||
});
|
||||
|
||||
throw redirect(301, 'https://cal.com/classroomio/demo');
|
||||
throw redirect(307, 'https://cal.com/classroomio/demo');
|
||||
};
|
||||
|
||||
@@ -7,5 +7,5 @@ export const load = ({ request }) => {
|
||||
event: 'discord page visited'
|
||||
});
|
||||
|
||||
throw redirect(301, 'https://discord.gg/dRmxBpJw59');
|
||||
throw redirect(307, 'https://discord.gg/dRmxBpJw59');
|
||||
};
|
||||
|
||||
@@ -3,10 +3,9 @@ import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId:
|
||||
request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'github page visited',
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'github page visited'
|
||||
});
|
||||
|
||||
throw redirect(301, 'https://github.com/rotimi-best/classroomio');
|
||||
throw redirect(307, 'https://github.com/rotimi-best/classroomio');
|
||||
};
|
||||
|
||||
@@ -3,13 +3,12 @@ import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId:
|
||||
request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'privacy page visited',
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'privacy page visited'
|
||||
});
|
||||
|
||||
throw redirect(
|
||||
301,
|
||||
307,
|
||||
'https://app.enzuzo.com/policies/privacy/958fc978-5477-11ee-a03b-7b111830c594'
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,5 +7,5 @@ export const load = ({ request }) => {
|
||||
event: 'signup'
|
||||
});
|
||||
|
||||
throw redirect(301, 'https://app.classroomio.com/signup');
|
||||
throw redirect(307, 'https://app.classroomio.com/signup');
|
||||
};
|
||||
|
||||
@@ -3,13 +3,9 @@ import { client } from '$lib/utils/posthog';
|
||||
|
||||
export const load = async ({ request }) => {
|
||||
client.capture({
|
||||
distinctId:
|
||||
request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'privacy page visited',
|
||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||
event: 'privacy page visited'
|
||||
});
|
||||
|
||||
throw redirect(
|
||||
301,
|
||||
'https://app.enzuzo.com/policies/tos/958fc978-5477-11ee-a03b-7b111830c594'
|
||||
);
|
||||
throw redirect(307, 'https://app.enzuzo.com/policies/tos/958fc978-5477-11ee-a03b-7b111830c594');
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
"nodemailer": "^6.9.5",
|
||||
"openai-edge": "^1.2.2",
|
||||
"pluralize": "^8.0.0",
|
||||
"posthog-js": "^1.87.2",
|
||||
"posthog-js": "^1.96.0",
|
||||
"sirv": "^2.0.3",
|
||||
"svelte-email": "^0.0.4",
|
||||
"svelte-ui": "workspace:*",
|
||||
|
||||
@@ -64,7 +64,7 @@ export async function fetchCourse(courseId?: Course['id'], slug?: Course['slug']
|
||||
if (!data || error) {
|
||||
console.log(`data`, data);
|
||||
console.log(`fetchCourse => error`, error);
|
||||
// return this.redirect(301, '/courses');
|
||||
// return this.redirect(307, '/courses');
|
||||
return { data, error };
|
||||
}
|
||||
|
||||
|
||||
@@ -31,15 +31,6 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
const matches = url.host.match(/([a-z 0-9 -]+).*classroomio[.]com/);
|
||||
const subdomain = matches?.[1] ?? '';
|
||||
|
||||
if (subdomain === 'app' && url.search && url.search?.includes('forwardTo')) {
|
||||
const params = new URLSearchParams(url.search);
|
||||
const forwardToURL = params.get('forwardTo');
|
||||
|
||||
if (forwardToURL) {
|
||||
throw redirect(307, forwardToURL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!blockedSubdomain.includes(subdomain)) {
|
||||
const answer = Array.isArray(matches) ? !!subdomain && subdomain !== 'www' : false;
|
||||
|
||||
@@ -48,12 +39,12 @@ export const load = async ({ url, cookies }): Promise<LoadOutput> => {
|
||||
response.org = (await getCurrentOrg(response.orgSiteName, true)) || null;
|
||||
|
||||
if (!response.org && !dev) {
|
||||
throw redirect(301, 'https://app.classroomio.com/404?type=org');
|
||||
throw redirect(307, 'https://app.classroomio.com/404?type=org');
|
||||
}
|
||||
} else if (subdomain === 'play' || debugPlay === 'true') {
|
||||
response.skipAuth = true;
|
||||
} else if (subdomain !== 'app' && !dev) {
|
||||
throw redirect(301, 'https://app.classroomio.com');
|
||||
throw redirect(307, 'https://app.classroomio.com');
|
||||
}
|
||||
|
||||
return response;
|
||||
|
||||
@@ -26,6 +26,6 @@ export const load = async ({ params = { hash: '' } }) => {
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Error decoding course invite params.hash', error);
|
||||
throw redirect(301, '/404');
|
||||
throw redirect(307, '/404');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,6 +29,6 @@ export const load = async ({ params = { hash: '' } }) => {
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Error decoding invite params.hash', error);
|
||||
throw redirect(301, '/404');
|
||||
throw redirect(307, '/404');
|
||||
}
|
||||
};
|
||||
|
||||
Generated
+4
-4
@@ -169,8 +169,8 @@ importers:
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0
|
||||
posthog-js:
|
||||
specifier: ^1.87.2
|
||||
version: 1.87.2
|
||||
specifier: ^1.96.0
|
||||
version: 1.96.0
|
||||
sirv:
|
||||
specifier: ^2.0.3
|
||||
version: 2.0.3
|
||||
@@ -9242,8 +9242,8 @@ packages:
|
||||
picocolors: 1.0.0
|
||||
source-map-js: 1.0.2
|
||||
|
||||
/posthog-js@1.87.2:
|
||||
resolution: {integrity: sha512-pdxEylfxwEDwwz7g5dunPucvAN51RAOWWQmkcqHsLNHlV5o5bTaTwcAXaWB1IUn3xKPuKYE2lqbdB3vC4H4rFQ==}
|
||||
/posthog-js@1.96.0:
|
||||
resolution: {integrity: sha512-nutEP3UbwjPt1a78KwBbdNBMhAY30lLjYXbBOPZ/juB9NDklmSqLF+lWImPcf6+rlXEhIboSr5sdTAF/R+Dasg==}
|
||||
dependencies:
|
||||
fflate: 0.4.8
|
||||
dev: false
|
||||
|
||||
Reference in New Issue
Block a user