add confirm email modal window
This commit is contained in:
+30
-4
@@ -1,7 +1,7 @@
|
||||
'use server'
|
||||
|
||||
import { loginFormSchema, API_BASE_URL, getSignupFormSchema } from '@/app/actions/definitions';
|
||||
import {createSession, deleteSession, getSessionData, updateSession} from '@/app/actions/session';
|
||||
import { createSession, deleteSession, getSessionData, updateSession } from '@/app/actions/session';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export async function logout() {
|
||||
@@ -138,8 +138,9 @@ export type FormState = {
|
||||
phone: string;
|
||||
companyName: string;
|
||||
agree: string;
|
||||
}
|
||||
error: Record<string, string>
|
||||
},
|
||||
mailConfirm?: boolean,
|
||||
error: Record<string, string> | null
|
||||
};
|
||||
|
||||
export async function registration(
|
||||
@@ -230,6 +231,20 @@ export async function registration(
|
||||
} else {
|
||||
throw (`${response.status}`);
|
||||
}
|
||||
console.log('/v1');
|
||||
return {
|
||||
previousState: {
|
||||
fullName,
|
||||
email,
|
||||
password,
|
||||
confirm_password,
|
||||
phone,
|
||||
companyName,
|
||||
agree
|
||||
},
|
||||
mailConfirm: true,
|
||||
error: null
|
||||
};
|
||||
} catch (error: unknown) {
|
||||
if (error) {
|
||||
const typedError = error as any;
|
||||
@@ -275,7 +290,9 @@ export async function registration(
|
||||
throw error;
|
||||
}
|
||||
|
||||
redirect('/pages/dashboard');
|
||||
/* redirect('/pages/dashboard'); */
|
||||
/* console.log('/v2');
|
||||
redirect('/v2'); */
|
||||
}
|
||||
|
||||
export async function tokenLifeExtension() {
|
||||
@@ -306,4 +323,13 @@ export async function tokenLifeExtension() {
|
||||
redirect('/login');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function confirmEmail(
|
||||
state: any | undefined,
|
||||
formData: any,
|
||||
) {
|
||||
console.log('confirmEmail');
|
||||
const emailConfirm = formData.get('emailConfirm') as string || '';
|
||||
console.log(emailConfirm);
|
||||
}
|
||||
Reference in New Issue
Block a user