@@ -3,6 +3,7 @@ import React, { useEffect } from 'react';
3
3
import { useSession , useSupabaseClient } from '@supabase/auth-helpers-react' ;
4
4
import { useRouter } from 'next/router' ; // Import the useRouter hook
5
5
import Layout from '../../components/Section/Layout' ;
6
+ import LoginPage from '../../components/Authentication/LoginModal' ;
6
7
7
8
const Login = ( ) => {
8
9
const session = useSession ( ) ;
@@ -19,12 +20,56 @@ const Login = () => {
19
20
return (
20
21
< div className = 'container' style = { { padding : '50px 0 100px 0' } } >
21
22
{ ! session ? (
22
- < div className = 'w-80%' > < Auth supabaseClient = { supabase } appearance = { { theme : ThemeSupa } } theme = 'dark' /> </ div >
23
+ // <div className='w-80%'><Auth supabaseClient={supabase} appearance={{ theme: ThemeSupa }} theme='dark' /></div>
24
+ < div > < LoginPage /> </ div >
23
25
) : (
24
26
< Layout > Logged in</ Layout >
25
27
) }
26
28
</ div >
27
29
) ;
28
- }
30
+ } ;
31
+
32
+ export default Login ;
33
+
34
+ /*
35
+ import { useHistory } from 'react-router-dom';
36
+ import { useEffect } from 'react';
37
+ import { Link } from 'react-router-dom';
38
+ import { LoginForm } from '@wasp/auth/forms/Login';
39
+ import { AuthWrapper } from './authWrapper';
40
+ import useAuth from '@wasp/auth/useAuth';
41
+
42
+ export default function Login() {
43
+ const history = useHistory();
29
44
30
- export default Login ;
45
+ const { data: user } = useAuth();
46
+
47
+ useEffect(() => {
48
+ if (user) {
49
+ history.push('/');
50
+ }
51
+ }, [user, history]);
52
+
53
+ return (
54
+ <AuthWrapper>
55
+ <LoginForm />
56
+ <br />
57
+ <span className='text-sm font-medium text-gray-900 dark:text-gray-900'>
58
+ Don't have an account yet?{' '}
59
+ <Link to='/signup' className='underline'>
60
+ go to signup
61
+ </Link>
62
+ .
63
+ </span>
64
+ <br />
65
+ <span className='text-sm font-medium text-gray-900'>
66
+ Forgot your password?{' '}
67
+ <Link to='/request-password-reset' className='underline'>
68
+ reset it
69
+ </Link>
70
+ .
71
+ </span>
72
+ </AuthWrapper>
73
+ );
74
+ }
75
+ */
0 commit comments