File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed
Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -27,21 +27,15 @@ export default async function DashboardPage() {
2727 < span > Home</ span >
2828 </ Link >
2929 < form action = { logout } >
30- < button
31- type = "submit"
32- className = "btn btn-neutral btn-outline"
33- >
30+ < button type = "submit" className = "btn btn-neutral btn-outline" >
3431 < span > Log out</ span >
3532 </ button >
3633 </ form >
3734 </ div >
38-
39-
4035
4136 < p className = "mt-4 text-neutral-600" >
42- You' re logged in as: < span className = "font-bold" > { user . email } </ span > .
37+ You' re logged in as: < span className = "font-bold" > { user . email } </ span > .
4338 </ p >
44-
4539 </ main >
4640 ) ;
4741}
Original file line number Diff line number Diff line change @@ -25,11 +25,18 @@ export default function AuthPage() {
2525 if ( error ) throw error ;
2626 } else {
2727 const { error } = await supabase . auth . signUp ( { email, password } ) ;
28- if ( error ) throw error ;
28+ if ( error ) throw error ;
2929 }
3030 router . push ( "/dashboard" ) ;
31- } catch ( e : any ) {
32- setErr ( e ?. message ?? "Something went wrong" ) ;
31+ } catch ( e : unknown ) {
32+ let errorMessage = "Something went wrong. Please try again" ;
33+
34+ if ( e instanceof Error ) {
35+ errorMessage = e . message ;
36+ } else if ( typeof e === "string" ) {
37+ errorMessage = e ;
38+ }
39+ setErr ( errorMessage ) ;
3340 } finally {
3441 setBusy ( false ) ;
3542 }
@@ -55,14 +62,12 @@ export default function AuthPage() {
5562 >
5663 Sign up
5764 </ button >
58- </ div >
65+ </ div >
5966
6067 { /* Optional info for signup */ }
6168 { mode === "signup" && (
6269 < div role = "alert" className = "alert alert-soft mb-2" >
63- < span >
64- Create an account with email & password .
65- </ span >
70+ < span > Create an account with email & password . </ span >
6671 </ div >
6772 ) }
6873
Original file line number Diff line number Diff line change 1+ export default function TutorialHelloWorld ( ) {
2+ return (
3+ < >
4+ < h1 > Hello World</ h1 >
5+ </ >
6+ ) ;
7+ }
You can’t perform that action at this time.
0 commit comments