small registration changes

This commit is contained in:
2024-12-16 18:55:21 -05:00
parent 9d33871114
commit e04c81b7f0
3 changed files with 8 additions and 16 deletions

View File

@@ -16,7 +16,6 @@ export default function SignInPage() {
e.preventDefault();
setError('');
try {
const response = await fetch('/api/auth/signup', {
method: 'POST',
@@ -28,12 +27,15 @@ export default function SignInPage() {
});
if (response.ok) {
console.log('Login successful');
router.push('/');
} else {
const data = await response.json();
console.log('Login failed:', data.error || 'Something went wrong');
setError(data.error || 'Something went wrong');
}
} catch (err) {
console.log('Login failed: Failed to create account');
setError('Failed to create account');
}
};