We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aea8c9e commit 9c42d78Copy full SHA for 9c42d78
1 file changed
apps/ticket/src/app/(pages)/auth/page.tsx
@@ -1,6 +1,6 @@
1
"use client";
2
3
-import { useCallback, useEffect } from "react";
+import { useCallback, useEffect, useRef } from "react";
4
import { useRouter, useSearchParams } from "next/navigation";
5
6
import { useLoginMutation } from "@/data/users/postUserLogin/mutation";
@@ -36,7 +36,13 @@ const AuthPage = () => {
36
37
const { mutateAsync } = useLoginMutation();
38
39
+ const isLoginProcessingRef = useRef(false);
40
+
41
const handleLogin = useCallback(async () => {
42
+ if (isLoginProcessingRef.current) return;
43
44
+ isLoginProcessingRef.current = true;
45
46
if (authorizationCode) {
47
try {
48
await mutateAsync({
0 commit comments