Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update frontend/src/pages/Register.jsx
Browse files
frontend/src/pages/Register.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import React, { useState, useEffect } from 'react';
|
| 2 |
import { Link, useNavigate } from 'react-router-dom';
|
| 3 |
import { useAuth } from '../components/AuthContext';
|
|
|
|
| 4 |
|
| 5 |
export const Register = () => {
|
| 6 |
const [fullName, setFullName] = useState('');
|
|
@@ -58,8 +59,8 @@ export const Register = () => {
|
|
| 58 |
|
| 59 |
const data = await res.json();
|
| 60 |
if (res.ok) {
|
| 61 |
-
|
| 62 |
-
navigate('/
|
| 63 |
} else {
|
| 64 |
setError(data.message || 'Registration failed. Please try again.');
|
| 65 |
}
|
|
|
|
| 1 |
import React, { useState, useEffect } from 'react';
|
| 2 |
import { Link, useNavigate } from 'react-router-dom';
|
| 3 |
import { useAuth } from '../components/AuthContext';
|
| 4 |
+
import toast from 'react-hot-toast';
|
| 5 |
|
| 6 |
export const Register = () => {
|
| 7 |
const [fullName, setFullName] = useState('');
|
|
|
|
| 59 |
|
| 60 |
const data = await res.json();
|
| 61 |
if (res.ok) {
|
| 62 |
+
toast.success('Account created successfully! Please sign in with your credentials.');
|
| 63 |
+
navigate('/login', { state: { email } });
|
| 64 |
} else {
|
| 65 |
setError(data.message || 'Registration failed. Please try again.');
|
| 66 |
}
|