Skip to content

Commit f78b6a5

Browse files
committed
google + github oauth
1 parent a3d450c commit f78b6a5

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

components/forms/Login.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import EmailIcon from '../icons/EmailIcon';
1414
import PasswordIcon from '../icons/PasswordIcon';
1515
import Image from 'next/image';
1616
import Google from '../../public/Google__G__Logo.svg.png';
17-
import Twitter from '../../public/twitter2.png';
17+
import Github from '../../public/github.png';
1818

1919
export default function Login({
2020
setServerError,
@@ -55,6 +55,16 @@ export default function Login({
5555
const { data, error } = await supabase.auth.signInWithOAuth({
5656
provider: 'google',
5757
});
58+
if (error) console.log(error);
59+
}
60+
61+
async function signInWithGitHub() {
62+
const { data, error } = await supabase.auth.signInWithOAuth({
63+
provider: 'github',
64+
options: {
65+
scopes: 'user',
66+
},
67+
});
5868
}
5969
return (
6070
<form className="flex flex-col" onSubmit={handleSubmit(onSubmit)}>
@@ -141,7 +151,7 @@ export default function Login({
141151
active:shadow-sm
142152
active:bg-frost-800
143153
font-bold
144-
py-2
154+
py-2
145155
w-9
146156
rounded-2xl
147157
tracking-widest
@@ -177,8 +187,14 @@ export default function Login({
177187
flex justify-center
178188
hover:cursor-pointer
179189
`}
190+
onClick={() => signInWithGitHub()}
180191
>
181-
<Image className="w-6 " src={Twitter} alt="Twitter" priority />
192+
<Image
193+
className="w-6 rounded-3xl"
194+
src={Github}
195+
alt="Github"
196+
priority
197+
/>
182198
</div>
183199
</div>
184200
</div>

public/github.png

7.08 KB
Loading

0 commit comments

Comments
 (0)