Production code
feat : 2 factor authentication , OTP service , Session timeout
This commit is contained in:
@@ -13,7 +13,6 @@ import dynamic from 'next/dynamic';
|
||||
import { generateCaptcha } from '@/app/captcha';
|
||||
import { IconRefresh, IconShieldLockFilled } from "@tabler/icons-react";
|
||||
import dayjs from "dayjs";
|
||||
import { IconTrash } from "@tabler/icons-react";
|
||||
import { fetchAndStoreUserName } from "../_util/userdetails";
|
||||
|
||||
|
||||
@@ -47,8 +46,8 @@ export default function Login() {
|
||||
}
|
||||
try {
|
||||
console.log(CIF);
|
||||
// await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile });
|
||||
await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' });
|
||||
await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: mobile });
|
||||
// await sendOtp({ type: 'LOGIN_OTP', username: CIF, mobileNumber: '7890544527' });
|
||||
notifications.show({
|
||||
color: "orange",
|
||||
title: "OTP Required",
|
||||
@@ -69,8 +68,8 @@ export default function Login() {
|
||||
async function handleVerifyOtp(mobile?: string) {
|
||||
try {
|
||||
if (mobile) {
|
||||
// await verifyLoginOtp(otp, mobile);
|
||||
await verifyLoginOtp(otp, '6297421727');
|
||||
await verifyLoginOtp(otp, mobile);
|
||||
// await verifyLoginOtp(otp, '7890544527');
|
||||
return true;
|
||||
}
|
||||
} catch {
|
||||
@@ -102,7 +101,6 @@ export default function Login() {
|
||||
}, []);
|
||||
|
||||
const regenerateCaptcha = () => {
|
||||
// setCaptcha(generateCaptcha());
|
||||
const loadCaptcha = async () => {
|
||||
const newCaptcha = await generateCaptcha();
|
||||
setCaptcha(newCaptcha);
|
||||
|
||||
Reference in New Issue
Block a user