Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Commit 672e1b5

Browse files
authored
Merge pull request #91 from WildCodeSchool/feature/redirection
Redirection vers LOG IN when signed up
2 parents fdab1f1 + 94334e9 commit 672e1b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/frontend/web/src/pages/register.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { FormEvent } from 'react';
22
import { useState } from 'react';
3-
import { Link } from 'react-router-dom';
3+
import { Link, useNavigate } from 'react-router-dom';
44

55
import ErrorForm from '@/components/errors-form';
66
import Input from '@/components/input';
@@ -11,6 +11,7 @@ export default function Register() {
1111
const [isAccepted, setIsAccepted] = useState(false);
1212
const [errors, setErrors] = useState<Record<string, string>>({});
1313
const [message, setMessage] = useState('');
14+
const navigate = useNavigate();
1415

1516
const passwordCriteria = {
1617
minLength: password.length >= 8,
@@ -64,6 +65,7 @@ export default function Register() {
6465
setEmail('');
6566
setPassword('');
6667
setIsAccepted(false);
68+
await navigate('/login');
6769
}
6870
} catch (error) {
6971
console.error(error);

0 commit comments

Comments
 (0)