-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big refactor #166
Big refactor #166
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { Database } from '../../../types/supabase'; | |
import React, { useState } from 'react'; | ||
import { AuthError } from '@supabase/supabase-js'; | ||
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'; | ||
import ErrorAlert from './ErrorAlert'; | ||
import Error from '../shared/Error'; | ||
import { useRouter } from 'next/router'; | ||
|
||
export default function SignUpForm() { | ||
|
@@ -13,7 +13,7 @@ export default function SignUpForm() { | |
useState<boolean>(false); | ||
const { push } = useRouter(); | ||
|
||
async function signUp(email: string, password: string) { | ||
const signUp = async (email: string, password: string) => { | ||
setIsMainButtonDisabled(true); | ||
const { data, error } = await supabase.auth.signUp({ | ||
email, | ||
|
@@ -26,7 +26,7 @@ export default function SignUpForm() { | |
supabase.auth.signInWithPassword({ email, password }); | ||
push('/home'); | ||
} | ||
} | ||
}; | ||
|
||
async function onFormSubmit(event: React.FormEvent<HTMLFormElement>) { | ||
event.preventDefault(); | ||
|
@@ -41,12 +41,12 @@ export default function SignUpForm() { | |
|
||
return ( | ||
<> | ||
{error && <ErrorAlert error={error} />} | ||
{<Error error={error} session={null} />} | ||
<form | ||
className="space-y-6" | ||
action="#" | ||
method="POST" | ||
onSubmit={onFormSubmit} | ||
onSubmit={() => onFormSubmit} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ellipsis-dev fix it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ellipsis-dev fix it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. asdasd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ellipsis-dev fix it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. asd |
||
> | ||
<div> | ||
<label | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Error
component is being used with asession
prop set tonull
. This might cause issues if theError
component expects a valid session. Please ensure that theError
component can handle anull
session.