Commit 687cbc93 by Arjun Jhukal

redrection after login at admin fixed

parent ff25bf81
......@@ -77,7 +77,8 @@ export default function LoginPage() {
secure: process.env.NODE_ENV === 'production',
sameSite: 'Strict',
});
router.replace("/credentials");
console.log("Login Response:", response?.data?.user?.role.toLowerCase() === "admin");
router.replace(response?.data?.user?.role?.toLowerCase() === "admin" ? "/" : "/credentials");
}
catch (e: any) {
dispatch(
......
......@@ -109,7 +109,6 @@ import { useFormik } from 'formik';
import { useRouter } from 'next/navigation';
import Script from 'next/script';
import { useState } from 'react';
import * as Yup from 'yup';
import { PaymentModeProps } from '.';
declare global {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment