diff --git a/frontend/src/components/SignInButtons/index.tsx b/frontend/src/components/SignInButtons/index.tsx index fed71564..1d9f31e1 100644 --- a/frontend/src/components/SignInButtons/index.tsx +++ b/frontend/src/components/SignInButtons/index.tsx @@ -8,8 +8,6 @@ import { useNavigate } from "react-router-dom"; import { signInWithPopup, GoogleAuthProvider, OAuthProvider, GithubAuthProvider, User } from "firebase/auth"; import { auth } from "../../config/firebase"; - - const SignInGoogle = async () => { const provider = new GoogleAuthProvider(); return signInWithPopup(auth, provider); @@ -39,20 +37,8 @@ const SignInGitHub = () => { return signInWithPopup(auth, provider); } -export const SignInButtons = ({isBroken}: {isBroken: boolean}) => { +export const SignInButtons = ({ isBroken }: { isBroken: boolean }) => { const navigate = useNavigate(); - const handleSignIn = async (provider: String) => { - switch (provider) { - case 'Google': await SignInGoogle().then((crendentialUser) => redirect(crendentialUser.user)); - break; - case 'Apple': await SignInApple().then((crendentialUser) => redirect(crendentialUser.user)); - break; - case 'Microsoft': await SignInMicrosoft().then((crendentialUser) => redirect(crendentialUser.user)); - break; - case 'GitHub': await SignInGitHub().then((crendentialUser) => redirect(crendentialUser.user)); - break; - } - } const redirect = (user: User) => { if (user?.emailVerified) { @@ -63,37 +49,51 @@ export const SignInButtons = ({isBroken}: {isBroken: boolean}) => { }; const styles = isBroken ? SignInButtonsStyles.buttonMobile : SignInButtonsStyles.button; - + return ( -