diff --git a/src/app/home/layout.module.css b/src/app/home/layout.module.css
deleted file mode 100644
index 851a4bf..0000000
--- a/src/app/home/layout.module.css
+++ /dev/null
@@ -1,80 +0,0 @@
-.title {
- color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
- font-family:
- Greycliff CF,
- var(--mantine-font-family);
-}
-
-.navbar {
- flex-grow: 1;
- padding: var(--mantine-spacing-md);
- display: flex;
- flex-direction: column;
-}
-
-.navbarMain {
- flex: 1;
-}
-
-.header {
- padding-bottom: var(--mantine-spacing-md);
- margin-bottom: calc(var(--mantine-spacing-md) * 1.5);
- border-bottom: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
-}
-
-.user {
- padding: var(--mantine-spacing-md);
- color: light-dark(var(--mantine-color-black), var(--mantine-color-dark-0));
- border-radius: var(--mantine-radius-sm);
-
- @mixin hover {
- background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-8));
- }
-}
-
-.footer {
- padding-top: var(--mantine-spacing-md);
- margin-top: var(--mantine-spacing-md);
- border-top: rem(1px) solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4));
-}
-
-.link {
- cursor: pointer;
- display: flex;
- align-items: center;
- text-decoration: none;
- font-size: var(--mantine-font-size-sm);
- color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
- padding: var(--mantine-spacing-xs) var(--mantine-spacing-sm);
- border-radius: var(--mantine-radius-sm);
- font-weight: 500;
-
- @mixin hover {
- background-color: light-dark(var(--mantine-color-gray-0), var(--mantine-color-dark-6));
- color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
-
- .linkIcon {
- color: light-dark(var(--mantine-color-black), var(--mantine-color-white));
- }
- }
-
- &[data-active] {
- &,
- &:hover {
- background-color: var(--mantine-primary-color-light);
- color: var(--mantine-primary-color-light-color);
-
- .linkIcon {
- color: var(--mantine-primary-color-light-color);
- }
- }
- }
-}
-
-.linkIcon {
- color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2));
- margin-right: var(--mantine-spacing-sm);
- width: rem(25px);
- height: rem(25px);
-}
-
diff --git a/src/app/home/layout.tsx b/src/app/home/layout.tsx
deleted file mode 100644
index b2695bf..0000000
--- a/src/app/home/layout.tsx
+++ /dev/null
@@ -1,159 +0,0 @@
-"use client"
-
-import React, { useContext, useState } from "react";
-import { UserContext } from "../_components/user-context";
-import { redirect } from "next/navigation";
-
-import { AppShell, Burger, Group, Image, Text, LoadingOverlay, Avatar, UnstyledButton, Title, Skeleton, Center, Switch, NavLink, ScrollArea, Code } from '@mantine/core';
-import { IconLogout, IconExclamationCircle, IconNotes, IconCategory, IconTicket, IconEye } from '@tabler/icons-react';
-import { useDisclosure } from '@mantine/hooks';
-import classes from './layout.module.css';
-import { KccbTheme } from "../_themes/KccbTheme";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import Link from "next/link";
-import { notifications } from "@mantine/notifications";
-import axios, { AxiosError } from "axios";
-import { useRouter } from "next/navigation";
-
-
-async function logout() {
- try {
- await axios.post('/api/auth/logout');
- } catch (error: AxiosError | any) {
- notifications.show({
- color: 'red',
- title: error.code,
- message: error.message
- })
- }
-}
-
-export default function HomeLayout({
- children,
-}: Readonly<{
- children: React.ReactNode;
-}>) {
-
- const user = useContext(UserContext);
- if (user === null) redirect('/login');
-
- const router = useRouter();
-
- const queryClient = useQueryClient();
-
- const [burgerOpened, { toggle: toggleBurger }] = useDisclosure();
- const [activeNavItem, setActiveNavItem] = useState(null);
-
- const logoutMutation = useMutation({
- mutationKey: ['logout'],
- mutationFn: logout
- })
-
- async function handleLogout(event: React.MouseEvent) {
- event.preventDefault();
- await logoutMutation.mutateAsync();
- await queryClient.refetchQueries({ queryKey: ['user'] })
- }
-
- let navItems: React.ReactNode[] = [];
-
- navItems.push(<>
-
-
- Create Ticket
- >
- }
- active={activeNavItem === 'raised-ticket' || undefined}
- onClick={event => {
- event.preventDefault();
- setActiveNavItem('raised-ticket')
- router.push('/home/user/raised-ticket')
- }}
- />
-
- View Ticket
- >
- }
- active={activeNavItem === 'view-ticket' || undefined}
- onClick={event => {
- event.preventDefault();
- setActiveNavItem('view-ticket')
- router.push('/home/user/view-ticket');
- }}
- />
- >
- )
-
- return (
- <>
-
-
- {user &&
-
-
-
-
-
- Customer Request Management
-
- {/*
-
- {
- setActiveNavItem(null);
- router.push('/home/user');
- }}>
-
- */}
-
-
-
-
-
- Account No: [{user.bank_account_no}]
-
- {/* User:
- {user.id}
*/}
-
-
-
-
-
- Menu
-
-
-
-
- {children}
-
- }
- >
- )
-}
\ No newline at end of file
diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx
index 6bbd9c5..5a42e81 100644
--- a/src/app/home/page.tsx
+++ b/src/app/home/page.tsx
@@ -1,18 +1,38 @@
"use client";
-import { UserContextConsumer } from "../_components/user-context";
+import { Button } from "@mantine/core";
+import { useRouter } from "next/navigation";
+import { useEffect, useState } from "react";
+
+
export default function Home() {
- return (
+ const[authorized,SetAuthorized] =useState(null);
+ const router = useRouter();
+
+ async function handleLogout(e: React.FormEvent) {
+ e.preventDefault();
+ localStorage.removeItem("access_token");
+ router.push("/login")
+ }
+ useEffect(() => {
+ const token = localStorage.getItem("access_token");
+ if (!token) {
+ SetAuthorized(false);
+ router.push("/login");
+ }
+ else{
+ SetAuthorized(true);
+ }
+ }, []);
+
+ if(authorized){
+ return (
<>
- Welcome to IB Portal
-
- {
- user => user && Your Present Login Account No: {user.bank_account_no}
- }
-
- For raise a complain or assistance ,please click on Create Ticket
- For track a ticket ,please click on View Ticket
+ Welcome to IB portal
+
>
);
+ }
+
}
diff --git a/src/app/home/user/raised-ticket/page.tsx b/src/app/home/user/raised-ticket/page.tsx
deleted file mode 100644
index 4fd7615..0000000
--- a/src/app/home/user/raised-ticket/page.tsx
+++ /dev/null
@@ -1,263 +0,0 @@
-"use client";
-
-import { notifications } from "@mantine/notifications";
-import axios, { AxiosError } from "axios";
-import React, { useState } from "react";
-
-const ComplaintForm: React.FC = () => {
- const [category, setCategory] = useState("");
- const [description, setDescription] = useState("");
- const [additionalFields, setAdditionalFields] = useState([]);
- const [additionalFieldValues, setAdditionalFieldValues] = useState>({});
- const [message, setMessage] = useState("");
-
- const handleCategoryChange = (e: React.ChangeEvent) => {
- const selectedCategory = e.target.value;
- setCategory(selectedCategory);
- setDescription(""); // Reset description when category changes
- setAdditionalFields([]);
- setAdditionalFieldValues({});
- };
-
- const handleDescriptionClick = () => {
- if (!category) {
- alert("Please select the Category of Complaint first.");
- }
- };
-
- const handleDescriptionChange = (e: React.ChangeEvent) => {
- if (!category) {
- setDescription(""); // Prevent changing description without category
- return;
- }
-
- const selectedDescription = e.target.value;
- setDescription(selectedDescription);
-
- // Add additional fields for specific descriptions
- if (selectedDescription === "Transaction Issue") {
- setAdditionalFields([
- "Debit Card",
- "Transaction Amount",
- "Transaction Reference Number ",
- "Transaction Date",
- "ATM ID/Terminal ID",
- ]);
- }
- else if(selectedDescription === "Fund Transfer failure"){
- setAdditionalFields([
- "Transaction Amount",
- "Transaction ID/Transaction Reference Number",
- "Transaction Date"
- ]);
- }
- else {
- setAdditionalFields([]);
- }
- };
-
- const handleAdditionalFieldChange = (field: string, value: string) => {
- if(field === "Transaction Amount" && isNaN(Number(value)))
- {
- alert ('Please enter a valid number');
- return;
- }
- if(field === "Debit Card" && isNaN(Number(value)))
- {
- alert ('Please Enter Valid Debit Card Number');
- return;
- }
- setAdditionalFieldValues((prevValues) => ({
- ...prevValues,
- [field]: value,
- }));
- };
-
- async function handleSubmit(e: React.FormEvent) {
- e.preventDefault();
- for (const field of additionalFields) {
- if (!additionalFieldValues[field]) {
- alert(`Please fill in the ${field}`);
- return;
- }
- }
- if (!message.trim()) {
- alert("Message field is required.");
- return;
- }
-
- const additionalInformation: string[] = [];
- if (additionalFieldValues['ATM ID/Terminal ID']) {
- additionalInformation.push(`ATM ID: ${additionalFieldValues['ATM ID/Terminal ID']}`);
- }
- if (additionalFieldValues['Debit Card']) {
- additionalInformation.push(`Debit Card: ${additionalFieldValues['Debit Card']}`);
- }
- if (additionalFieldValues['Transaction Amount']) {
- additionalInformation.push(`Transaction Amount: ${additionalFieldValues['Transaction Amount']}`);
- }
- if (additionalFieldValues['Transaction Reference Number ']) {
- additionalInformation.push(`Transaction Reference Number : ${additionalFieldValues['Transaction Reference Number ']}`);
- }
- if (additionalFieldValues['Transaction Date']) {
- additionalInformation.push(`Transaction Date: ${additionalFieldValues['Transaction Date']}`);
- }
- if(additionalFieldValues['Transaction ID/Transaction Reference Number']){
- additionalInformation.push(`Transaction ID/Transaction Reference Number: ${additionalFieldValues['Transaction ID/Transaction Reference Number']}`);
- }
-
- const requestBody = {
- summary: category,
- description: description,
- additional_information: additionalInformation.join(", "),
- steps_to_reproduce: message,
- };
-
- try {
- const response = await axios.post("/api/ticket", requestBody);
- const data = await response.data;
- alert(data.message);
- window.location.reload();
- }
- catch (error: AxiosError | any) {
- notifications.show({
- color: 'red',
- title: error.response.status,
- message: error.response.data.message
- })
- }
- }
-
- return (
-
- );
-};
-
-export default ComplaintForm;
diff --git a/src/app/home/user/view-ticket/page.tsx b/src/app/home/user/view-ticket/page.tsx
deleted file mode 100644
index a92f47e..0000000
--- a/src/app/home/user/view-ticket/page.tsx
+++ /dev/null
@@ -1,332 +0,0 @@
-"use client";
-
-import {
- ActionIcon,
- Button,
- Container,
- Flex,
- Group,
- Modal,
- Space,
- Table,
- TextInput,
- Title,
- Tooltip,
-} from "@mantine/core";
-import { useDisclosure } from "@mantine/hooks";
-import { IconDisabled, IconEye, IconMessage, IconSearch, IconTrash ,IconArrowsUpDown} from "@tabler/icons-react";
-import axios, { AxiosError } from "axios";
-import { useEffect, useState } from "react";
-import { notifications } from "@mantine/notifications";
-
-interface Message {
- note: string;
- time:string;
-}
-
-interface Ticket {
- ticket_id: string;
- category_of_request: string;
- nature_of_request: string;
- created_date: string;
- status: string;
- message: Message[];
-}
-interface TicketDetails {
- ticket_id: string;
- category_of_request: string;
- nature_of_request: string;
- additional_info: string;
- message : string;
- created_date: string;
-
-}
-export default function Page() {
- const [opened, { open, close }] = useDisclosure(false);
- const [tickets, setTickets] = useState([]);
- const [searchQuery, setSearchQuery] = useState("");
- const [filteredTickets, setFilteredTickets] = useState([]);
- const [activeMessages, setActiveMessages] = useState(null);
- const [ticketDetails, setTicketDetails] = useState(null);
- const [ticketStatus, setTicketStatus] = useState(null);
- const [sortOrder,setSortOrder]= useState<"asc" |"desc">("desc");
-
- const [detailsOpened, { open: openDetails, close: closeDetails }] = useDisclosure(false);
-
- // For view ticket details
- const handleOpenDetails = async (ticketId: string) => {
- try {
- const response = await axios.get(`/api/ticket/${ticketId}`); // Assuming API provides details
- setTicketDetails(response.data);
- openDetails();
- }
- catch(error: AxiosError | any) {
- console.error("Failed to fetch ticket details:", error);
- notifications.show({
- color: 'red',
- title: error.response.status,
- message: error.response.data.message
- })
- }
- };
- // For parsing additional_info
- const parseAdditionalInfo = (info: string) => {
- return info.split(", ").map((item) => {
- const [key, value] = item.split(": ");
- return { key: key.trim(), value: value?.trim() || "" };
- });
- };
- // For delete a ticket
- const handleDelete = async (ticketId: string) => {
- const isConfirm =window.confirm("Do you want to delete the ticket?");
- if(!isConfirm)
- return;
- try {
- const response = await axios.delete(`/api/ticket/${ticketId}`); // Assuming API provides details
- const data = await response.data;
- alert(data.message);
- }
- catch(error: AxiosError | any) {
- console.error("Failed to delete ticket:", error);
- notifications.show({
- color: 'red',
- title: error.response.status,
- message: error.response.data.message
- })
- }
- finally{
- window.location.reload();
- }
- };
- // Sort and filter tickets based on the time
- useEffect(() => {
- const sortedTickets = [...tickets].sort(
- // (a, b) => new Date(b.created_date).getTime() - new Date(a.created_date).getTime()
- (a, b) => parseInt(b.ticket_id) - parseInt(a.ticket_id)
- );
- const results = sortedTickets.filter((ticket) =>
- ticket.category_of_request.toLowerCase().includes(searchQuery.toLowerCase())
- );
- setFilteredTickets(results);
- }, [searchQuery, tickets]);
-
- // Fetch tickets from API
- useEffect(() => {
- async function fetchTickets() {
- try {
- const response = await axios.get("/api/ticket");
- setTickets(response.data);
- } catch (error) {
- console.error("Failed to fetch tickets: ", error);
- }
- }
- fetchTickets();
- }, []);
-
- // Sorting the ticket when any ticket resolved the go to the end of the list
- useEffect(() => {
- const sortedTickets = [...tickets].sort((a, b) => {
- if (a.status.toLowerCase() === "resolved" && b.status.toLowerCase() !== "resolved") return 1;
- if (b.status.toLowerCase() === "resolved" && a.status.toLowerCase() !== "resolved") return -1;
- return parseInt(b.ticket_id) - parseInt(a.ticket_id); // Sort by ticket ID otherwise
- });
- const results = sortedTickets.filter(ticket =>
- ticket.category_of_request.toLowerCase().includes(searchQuery.toLowerCase())
- );
- setFilteredTickets(results);
- }, [searchQuery, tickets]);
-
- // For sorting ticket history according to time
- const sortedMessages = activeMessages
- ? [...activeMessages].sort((a, b) => {
- const timeA = new Date(a.time).getTime();
- const timeB = new Date(b.time).getTime();
- return sortOrder === "asc" ? timeA - timeB : timeB - timeA;
- })
- : [];
-
- const handleOpenMessage = (messages: Message[],status:string) => {
- console.log(messages);
- setActiveMessages(messages);
- setTicketStatus(status);
- open();
- };
-
- //Add conditional row styles
- const getRowStyle = (status: string) => {
- switch (status.toLowerCase()) {
- case "resolved":
- // return { backgroundColor: "#d9d9d9", color: "#a6a6a6"}; // Grey for closed
- return {color: "#a6a6a6"}; // Grey for closed
- default:
- return {};
- }
- };
-
- const rows = filteredTickets.map((ticket) => (
- {/* added for coloured grey */}
- {/* */}
- {ticket.ticket_id}
- {ticket.category_of_request}
- {ticket.nature_of_request}
- {ticket.created_date}
- {ticket.status}
-
-
- handleOpenMessage(ticket.message,ticket.status)}
- >
-
-
-
- {/* design for badge */}
-
-
-
-
-
-
-
- handleOpenDetails(ticket.ticket_id)}>
-
-
-
-
-
- {/* Remove delete icon */}
- {/* handleDelete(ticket.ticket_id)}>
-
-
-
- */}
-
-
-
-
- ));
- return (
-
- View Ticket
-
-
-
- Tickets
-
- setSearchQuery(event.currentTarget.value)}
- radius="md"
- w={250}
- leftSection={}
- />
-
-
-
-
-
-
- Ticket ID
- Category
- Description
- Timestamp
- Status
- History
- Action
-
-
- {rows}
-
-
-
-
- Ticket History
- setSortOrder(sortOrder === "asc" ? "desc" : "asc")}
- >
-
-
-
-
-
-
- {sortedMessages?.map((msg, index) => (
-
-
{msg.note}
- {/* //Fetch the note IST time */}
-
Internal team send by {new Date(Number(msg.time)*1000).toLocaleString('en-IN',{timeZone: 'Asia/Kolkata'})}
-
- ))}
- {ticketStatus?.toLowerCase()=== "resolved" && (
-
----- Ended Chat ------
-
)}
- {/* Fixed Close Button */}
-
-
-
-
-
-
-
- {ticketDetails ? (
-
- Ticket ID: {ticketDetails.ticket_id}
- Category of Complaint: {ticketDetails.category_of_request}
- Description: {ticketDetails.nature_of_request}
- {/* Additional Information: {ticketDetails.additional_info}
*/}
- {/* Additional Info Table */}
- Additional Info:
-
-
- {parseAdditionalInfo(ticketDetails.additional_info).map((item, index) => (
-
- {item.key}
- {item.value}
-
- ))}
-
-
- Message: {ticketDetails.message}
- Created Date: {ticketDetails.created_date}
-
-
- ) : (
- Loading details...
- )}
-
-
- );
-}
diff --git a/src/app/login/otp/page.tsx b/src/app/login/otp/page.tsx
deleted file mode 100644
index 67a807b..0000000
--- a/src/app/login/otp/page.tsx
+++ /dev/null
@@ -1,195 +0,0 @@
-"use client"
-
-import classes from '../page.module.css';
-import React, { useContext, useEffect, useState } from "react";
-import { TextInput, Button, Container, Title, Image, SimpleGrid, LoadingOverlay, Avatar, Paper, Text, Group, Center } from "@mantine/core";
-import image from '../helpdesk.png';
-import { useForm, SubmitHandler } from "react-hook-form";
-import axios, { AxiosError } from "axios";
-import { notifications } from "@mantine/notifications";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import { useDisclosure } from "@mantine/hooks";
-
-
-type OtpInput = {
- OTP: number
-}
-
-type Result = {
- ok?: boolean
- message?: string
-}
-
-async function handleResendOTP() {
- let otp;
- try {
- const response = await axios.get("/api/otp");
- otp = response.data;
- console.log('OTP resent successfully:', response.data);
- // Object.assign(response.data);
- // alert(response.data.message);
- notifications.show({
- color: 'green',
- // title: error.code,
- message: response.data.message
- })
- } catch (error: AxiosError | any) {
- notifications.show({
- color: 'red',
- title: error.code,
- message: error.message
- })
- }
- return otp;
-}
-
-
-async function handleValidateOTP(OtpInput: OtpInput) {
- let Result: Result = { ok: false }
- try {
- const response = await axios.post("/api/otp", OtpInput);
- {
- window.location.href = '/home'
- }
- Object.assign(Result, response.data);
- } catch (error: AxiosError | any) {
- // alert(error.response.data.error);
- notifications.show({
- withBorder: true,
- color: 'red',
- title: error.response.status,
- message: error.response.data.error,
- autoClose: 4000,
- })
- }
- // For countdown reset every time after successful verification
- sessionStorage.removeItem('countdown');
- sessionStorage.removeItem('timerStart');
- return Result;
-}
-
-export default function CheckOTP() {
- const queryClient = useQueryClient();
- const { register, handleSubmit, formState: { errors } } = useForm();
- const [countdown, setCountdown] = useState(90);
- const [timerActive, setTimerActive] = useState(true);
-
- const validateOTPMutation = useMutation({
- mutationKey: ['validateOtp'],
- mutationFn: handleValidateOTP,
- })
- const resendOTPMutation = useQuery({
- queryKey: ['resendOTP'],
- queryFn: handleResendOTP,
- enabled: false,
- })
- ////
- useEffect(() => {
- if (typeof window !== 'undefined') {
- const savedCountdown = sessionStorage.getItem('countdown');
- const savedStartTime = sessionStorage.getItem('timerStart');
-
- if (savedCountdown && savedStartTime) {
- const elapsedTime = Math.floor((Date.now() - parseInt(savedStartTime, 10)) / 1000);
- const remainingTime = parseInt(savedCountdown, 10) - elapsedTime;
-
- if (remainingTime > 0) {
- setCountdown(remainingTime);
- setTimerActive(true);
- }
- else {
- setCountdown(0);
- setTimerActive(false);
- sessionStorage.removeItem('countdown');
- sessionStorage.removeItem('timerStart');
- }
- } else {
- sessionStorage.setItem('countdown', '90');
- sessionStorage.setItem('timerStart', Date.now().toString());
- setCountdown(90);
- setTimerActive(true);
- }
- }
- }, []);
-
- // Effect to manage the countdown timer
- useEffect(() => {
- if (!timerActive) return;
-
- const interval = setInterval(() => {
- setCountdown((prev) => {
- if (prev <= 1) {
- clearInterval(interval);
- setTimerActive(false);
- sessionStorage.removeItem('countdown');
- sessionStorage.removeItem('timerStart');
- return 0;
- }
- return prev - 1;
- });
- }, 1000);
-
- return () => clearInterval(interval); // Cleanup interval on unmount
- }, [timerActive]);
- /////
- const onSubmit: SubmitHandler = async (OtpInput) => {
- const Result = await validateOTPMutation.mutateAsync(OtpInput);
- if (Result.ok)
- await queryClient.refetchQueries({ queryKey: ['OTP'] });
- };
-
- const handleResend = async () => {
- resendOTPMutation.refetch();
- setCountdown(90);
- setTimerActive(true);
- sessionStorage.setItem('countdown', '90');
- sessionStorage.setItem('timerStart', Date.now().toString());
- }
-
- const [opened, { open, close }] = useDisclosure(false);
-
- return (
-
-
-
-
-
-
-
-
- Customer Request Management
-
-
- {errors.OTP && *Required}
-
- {timerActive ? `Resend OTP in ${countdown}s` : 'Resend OTP Available'}
-
-
-
- {validateOTPMutation.data?.message && {validateOTPMutation.data.message}}
-
- {/* {resendOTPMutation?.data?.message && {resendOTPMutation.data.message}} */}
-
-
-
-
-
-
-
- );
-}
-
-
-
diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx
index 0a7d913..c5efcae 100644
--- a/src/app/login/page.tsx
+++ b/src/app/login/page.tsx
@@ -7,12 +7,35 @@ import bgImage from '@/app/image/media.jpg';
import frontPage from '@/app/image/ib_front_page.jpg'
import NextImage from 'next/image';
import { Providers } from "@/app/providers";
+import { useRouter } from "next/navigation";
+import { notifications } from "@mantine/notifications";
export default function Login() {
const [CIF, SetCIF] = useState('');
const [psw, SetPsw] = useState('');
- async function handleLogin() {
+ const router = useRouter();
+ async function handleLogin(e:React.FormEvent) {
+ e.preventDefault();
+ // const login_password =localStorage.setItem("password",psw);
+ if (CIF === "30022497139" && psw === "SecurePass123!")
+ {
+ const token ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30";
+ localStorage.setItem("customerNumber",CIF);
+ localStorage.setItem("password",psw);
+ localStorage.setItem("access_token",token);
+ router.push("/home");
+ }
+
+ else {
+ notifications.show({
+ withBorder: true,
+ color: 'red',
+ title: "Wrong User Id or Password",
+ message: "Wrong User Id or Password",
+ autoClose: 5000,
+ })
+ }
}
return (
@@ -83,7 +106,7 @@ export default function Login() {
-