Continued updating the e-mail verification and I think I managed to get it working
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {NextApiRequest, NextApiResponse} from "next";
|
||||
import {getAuth, sendSignInLinkToEmail, User} from "firebase/auth";
|
||||
import {app} from "@/firebase";
|
||||
import {getAuth, sendEmailVerification, sendSignInLinkToEmail, User} from "firebase/auth";
|
||||
import {getAuth as getAdminAuth, UserRecord} from "firebase-admin/auth";
|
||||
import {app, adminApp} from "@/firebase";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
|
||||
@@ -11,7 +12,7 @@ export default withIronSessionApiRoute(sendVerification, sessionOptions);
|
||||
async function sendVerification(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (req.session.user) {
|
||||
sendSignInLinkToEmail(auth, req.session.user.email, {
|
||||
url: "https://encoach.com/",
|
||||
url: `https://encoach.com/${req.session.user.email}`,
|
||||
handleCodeInApp: true,
|
||||
})
|
||||
.then(() => res.status(200).json({ok: true}))
|
||||
|
||||
Reference in New Issue
Block a user