Stripe fix and email verification fix
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import { useNavigate, useSearchParams, Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import { Button } from '../components/ui/button';
|
||||
@@ -15,9 +15,16 @@ const VerifyEmail = () => {
|
||||
const [status, setStatus] = useState('loading');
|
||||
const [message, setMessage] = useState('');
|
||||
const token = searchParams.get('token');
|
||||
const hasVerified = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
const verifyEmail = async () => {
|
||||
// Prevent double execution in React StrictMode
|
||||
if (hasVerified.current) {
|
||||
return;
|
||||
}
|
||||
hasVerified.current = true;
|
||||
|
||||
if (!token) {
|
||||
setStatus('error');
|
||||
setMessage('Invalid verification link.');
|
||||
|
||||
Reference in New Issue
Block a user