-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏸🥘 ↝ Some styling, tests and auth experiments [ SGV2-6 ]
- Loading branch information
1 parent
5d9d69c
commit c0d0f30
Showing
7 changed files
with
43 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Auth, ThemeSupa } from '@supabase/auth-ui-react'; | ||
import React, { useEffect } from 'react'; | ||
import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react'; | ||
import { useRouter } from 'next/router'; // Import the useRouter hook | ||
import Layout from '../../components/Section/Layout'; | ||
import LoginPage from '../../components/Authentication/LoginModal'; | ||
|
||
const Register = () => { | ||
const session = useSession(); | ||
const supabase = useSupabaseClient(); | ||
const router = useRouter(); // Initialize the useRouter hook | ||
|
||
useEffect(() => { | ||
// Check if the user is logged in and then redirect | ||
if (session) { | ||
router.push('/feed'); | ||
} | ||
}, [session, router]); | ||
|
||
return ( | ||
<div className='container' style={{ padding: '50px 0 100px 0' }}> | ||
{!session ? ( | ||
<Layout><div className='w-80%'><Auth supabaseClient={supabase} appearance={{ theme: ThemeSupa }} theme='dark' /></div></Layout> | ||
) : ( | ||
<Layout>Logged in</Layout> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Register; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters