File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 11// See:
22// https://lucia-auth.com/guidebook/sign-in-with-username-and-password/sveltekit/
33// https://superforms.rocks/get-started
4- import { superValidate } from 'sveltekit-superforms/server' ;
5- import { zod } from 'sveltekit-superforms/adapters' ;
64import { fail , redirect } from '@sveltejs/kit' ;
75import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library' ;
86import { LuciaError } from 'lucia' ;
97
10- import { initializeAuthForm } from '$lib/utils/authorship' ;
11- import { authSchema } from '$lib/zod/schema' ;
8+ import { initializeAuthForm , validateAuthFormWithFallback } from '$lib/utils/authorship' ;
129import { auth } from '$lib/server/auth' ;
1310
1411import {
@@ -27,7 +24,7 @@ export const load: PageServerLoad = async ({ locals }) => {
2724// FIXME: エラー処理に共通部分があるため、リファクタリングをしましょう。
2825export const actions : Actions = {
2926 default : async ( { request, locals } ) => {
30- const form = await superValidate ( request , zod ( authSchema ) ) ;
27+ const form = await validateAuthFormWithFallback ( request ) ;
3128
3229 if ( ! form . valid ) {
3330 return fail ( BAD_REQUEST , {
You can’t perform that action at this time.
0 commit comments