mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:36:44 +00:00
fix resend email
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { setEmail } from "@/lib/zitadel";
|
||||
import { resendEmailCode } from "@/lib/zitadel";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const body = await request.json();
|
||||
if (body) {
|
||||
const { userId, code } = body;
|
||||
const { userId } = body;
|
||||
|
||||
// replace with resend Mail method once its implemented
|
||||
return setEmail(userId)
|
||||
return resendEmailCode(userId)
|
||||
.then((resp) => {
|
||||
return NextResponse.json(resp);
|
||||
})
|
||||
|
||||
@@ -345,8 +345,8 @@ export async function verifyEmail(userId: string, verificationCode: string) {
|
||||
* @param userId the id of the user where the email should be set
|
||||
* @returns the newly set email
|
||||
*/
|
||||
export async function setEmail(userId: string) {
|
||||
return userService.setEmail(
|
||||
export async function resendEmailCode(userId: string) {
|
||||
return userService.resendEmailCode(
|
||||
{
|
||||
userId,
|
||||
},
|
||||
|
||||
@@ -82,6 +82,9 @@ export default function VerifyEmailForm({
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
userId,
|
||||
}),
|
||||
});
|
||||
|
||||
const response = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user