From a640dc9d658e9c1ff115324717b895349cee04d5 Mon Sep 17 00:00:00 2001
From: Caner <s86215@bht-berlin.de>
Date: Sat, 3 Jun 2023 22:49:27 +0200
Subject: [PATCH] sign up fix

---
 components/auth-signup-form.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/auth-signup-form.tsx b/components/auth-signup-form.tsx
index 4eb7e63..1c1cb16 100644
--- a/components/auth-signup-form.tsx
+++ b/components/auth-signup-form.tsx
@@ -4,13 +4,14 @@ import { Alert } from '@/components/ui/alert'
 import { Button } from '@/components/ui/button'
 import { Input } from '@/components/ui/input'
 import { Label } from '@/components/ui/label'
-import { signIn } from 'next-auth/react'
 import { useState } from 'react'
+import { useRouter } from 'next/navigation'
 
 export const SignupForm = () => {
     const [email, setEmail] = useState('')
     const [password, setPassword] = useState('')
     const [error, setError] = useState<string | null>(null)
+    const router = useRouter(); 
 
     const onSubmit = async (e: React.FormEvent) => {
         e.preventDefault()
@@ -27,7 +28,7 @@ export const SignupForm = () => {
                 }
             })
             if (res.ok) {
-                signIn()
+                router.push("/login")
             } else {
                 setError((await res.json()).error)
             }
-- 
GitLab