redirect away from create form if account has name
This commit is contained in:
parent
362ce60287
commit
8a1d245468
10
src/routes/profile/create/+page.ts
Normal file
10
src/routes/profile/create/+page.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import {redirect} from '@sveltejs/kit';
|
||||
import type {PageLoad} from './$types';
|
||||
|
||||
export const load: PageLoad = async ({parent, url}) => {
|
||||
// the user has already done initial setup - go back to the normal profile
|
||||
const parentData = await parent();
|
||||
if (parentData.user && parentData.user.name) {
|
||||
throw redirect(302, '/profile');
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue