Skip to content

Commit

Permalink
Merge pull request #6 from fabriciopgl/feature/1
Browse files Browse the repository at this point in the history
🚧 Ajusta login do Google
  • Loading branch information
fabriciopgl authored Nov 23, 2024
2 parents a315de0 + a6e59d5 commit 9332557
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions components/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button } from "@nextui-org/react";
import axios from "axios";
import { jwtDecode, JwtPayload } from "jwt-decode";
import { useEffect } from "react";
import { FaGoogle, FaUser, FaWineGlassAlt } from "react-icons/fa";
import { FaUser, FaWineGlassAlt } from "react-icons/fa";
import waterfall from "../../public/images/backgrounds/waterfall_background.jpg";
import { GoogleIcon } from "./GoogleIcon";

Expand Down Expand Up @@ -50,7 +50,12 @@ export default function LoginComponent({ onSuccess }: LoginComponentProps) {
window.google.accounts.id.initialize({
client_id: googleClientId,
callback: handleCredentialResponse,
auto_select: false,
cancel_on_tap_out: true,
});

window.google.accounts.id.disableAutoSelect();

window.google.accounts.id.renderButton(
document.getElementById("signInDiv"),
{ theme: "outline", size: "large" }
Expand Down Expand Up @@ -92,12 +97,7 @@ export default function LoginComponent({ onSuccess }: LoginComponentProps) {
variant="bordered"
startContent={<GoogleIcon />}
className="w-full py-2 hover:bg-blue-50 hover:bg-opacity-80 border-[1px] border-[#dadce0] text-sm rounded-md flex justify-center items-center relative cursor-pointer mt-10"
onClick={() => {
const googleButton = document
.getElementById("signInDiv")
?.querySelector("div");
if (googleButton) googleButton.click();
}}
onClick={() => window.google.accounts.id.prompt()}
>
{/* Botão do Google invisível */}
<div
Expand Down

0 comments on commit 9332557

Please sign in to comment.