From b7b6ed2854b5fc2a502dfe4b6320c6925796ca95 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Oct 2022 22:30:38 +0100 Subject: [PATCH] feat: added github sign in --- src/components/SignIn/Social.tsx | 20 ++++++++++++++------ src/pages/signin.tsx | 3 ++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/SignIn/Social.tsx b/src/components/SignIn/Social.tsx index 689134f..ae0f4d5 100644 --- a/src/components/SignIn/Social.tsx +++ b/src/components/SignIn/Social.tsx @@ -1,11 +1,19 @@ -import { FaGithub, FaGoogle } from 'react-icons/fa'; +import { supabase } from '../../utils/supabaseClient'; +import { FaGithub } from 'react-icons/fa'; export function SignInSocial() { + const handleGitHubSignIn = async () => { + const { error } = await supabase.auth.signIn({ + provider: 'github', + }); + if (error) alert(error.message); + }; + return (

Sign in with

-
+ {/*
Sign in with Google -
+
*/}
- Sign in with GitHub - +
diff --git a/src/pages/signin.tsx b/src/pages/signin.tsx index b7e337f..6cdf2e7 100644 --- a/src/pages/signin.tsx +++ b/src/pages/signin.tsx @@ -2,6 +2,7 @@ import Image from 'next/future/image'; import Head from 'next/head'; import Link from 'next/link'; import { SignInForm } from '../components/SignIn/Form'; +import { SignInSocial } from '../components/SignIn/Social'; import { useEffect } from 'react'; import { useRouter } from 'next/router'; import type { PageProps } from '../lib/types'; @@ -30,7 +31,7 @@ export default function SignIn({ user }: PageProps) {

Sign in

{/* TODO: social sign in options */} - {/* */} +

Not registered yet?{' '}