-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
111 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ import { Banners } from "@/constants"; | |
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import OtpVerificationSection from "@/components/forms/patient/OtpForms"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { getPatientProfile } from "@/services/api/patientProtectedApis"; | ||
import UniversalSkelton from "@/components/skeletons/Universal"; | ||
import { useAuth } from "@/lib/hooks/useAuth"; | ||
|
||
|
@@ -18,7 +16,9 @@ const OtpVerificationPage = () => { | |
const { mutate: validateOtp, isPending } = useValidateOtpPatient(); | ||
const { toast } = useToast(); | ||
const navigate = useRouter(); | ||
const [isLoading,setLoading]= useState(true) | ||
const [isLoading,setLoading]= useState(true); | ||
const {setCredentials} = useAuth() | ||
|
||
|
||
const {patientToken} = useAuth() | ||
|
||
|
@@ -35,7 +35,7 @@ const OtpVerificationPage = () => { | |
validateOtp( | ||
{ email: "[email protected]", otp: parseInt(otp) }, | ||
{ | ||
onSuccess: () => { | ||
onSuccess: ({accessToken}) => { | ||
toast({ | ||
title: "Otp Verification Success ✅", | ||
description: "Authentication Completed!. let's book your first appointment", | ||
|
@@ -47,6 +47,7 @@ const OtpVerificationPage = () => { | |
), | ||
}); | ||
navigate.push("/"); | ||
setCredentials("patientToken",accessToken) | ||
}, | ||
onError: (error) => { | ||
toast({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7929d99
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
avm-care – ./
avm-care-sinans-projects-8d312afe.vercel.app
avm-care-git-main-sinans-projects-8d312afe.vercel.app
avm-care.vercel.app