Add redirect to layout's load
This commit is contained in:
@@ -65,10 +65,7 @@
|
|||||||
label="Login"
|
label="Login"
|
||||||
variant={VARIANTS.OUTLINED}
|
variant={VARIANTS.OUTLINED}
|
||||||
className="mx-2"
|
className="mx-2"
|
||||||
onClick={() => {
|
onClick={() => goto('/login' + redirect)}
|
||||||
console.log('clicked login');
|
|
||||||
goto('/login' + redirect);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<PrimaryButton
|
<PrimaryButton
|
||||||
label="Sign Up"
|
label="Sign Up"
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const load = ({ url }) => {
|
||||||
|
console.log('url', url.hostname);
|
||||||
|
|
||||||
|
if (url.hostname === 'classroomio.com' || url.hostname === 'classroomio.netlify.app') {
|
||||||
|
throw redirect(301, 'https://about.classroomio.com');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import type { Handle } from '@sveltejs/kit';
|
|
||||||
import { redirect } from '@sveltejs/kit';
|
|
||||||
|
|
||||||
export const handle = (async ({ event, resolve }) => {
|
|
||||||
if (event.url.host === 'classroomio.com') {
|
|
||||||
throw redirect(307, 'https://about.classroomio.com');
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await resolve(event);
|
|
||||||
return response;
|
|
||||||
}) satisfies Handle;
|
|
||||||
Reference in New Issue
Block a user