diff --git a/front/app/_orgs/[orgslug]/signup/page.tsx b/front/app/_orgs/[orgslug]/signup/page.tsx index 1eaac7a6..3f0fc0db 100644 --- a/front/app/_orgs/[orgslug]/signup/page.tsx +++ b/front/app/_orgs/[orgslug]/signup/page.tsx @@ -2,9 +2,11 @@ import React from "react"; import { Title } from "../../../../components/UI/Elements/Styles/Title"; import { signup } from "../../../../services/auth/auth"; +import { useRouter } from "next/navigation"; -const SignUp = (params : any) => { +const SignUp = (params: any) => { const org_slug = params.params.orgslug; + const router = useRouter(); const [email, setEmail] = React.useState(""); const [password, setPassword] = React.useState(""); const [username, setUsername] = React.useState(""); @@ -13,7 +15,13 @@ const SignUp = (params : any) => { e.preventDefault(); console.log({ email, password, username, org_slug }); alert(JSON.stringify({ email, password, username, org_slug })); - signup({ email, password, username, org_slug }); + try { + signup({ email, password, username, org_slug }); + router.push("/"); + } + catch (err) { + console.log(err); + } }; const handleEmailChange = (e: any) => { @@ -33,14 +41,76 @@ const SignUp = (params : any) => {
Sign up -
- - - - -
+ {/* Create a login ui with tailwindcss */} +
+
+
+
+ + + + + + + + + + + + + + + Already have an account? Login + + + + Home + + + +
+
+ +
+
);