MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.09k stars 137 forks source link

GoogleLogin button is not responsive #350

Open nachodeh opened 5 months ago

nachodeh commented 5 months ago

It's currently not possible to make the button take up 100% of the available width. It does initially when rendering but immediately updates to some smaller size. This makes it very hard to make the button fit into any website's style.

vasanthmn1 commented 4 months ago

Use Custom Google Button

import { useGoogleLogin } from '@react-oauth/google';

const login = useGoogleLogin({
  onSuccess: tokenResponse => console.log(tokenResponse),
});

<MyCustomButton onClick={() => login()}>Sign in with Google 🚀</MyCustomButton>;
nachodeh commented 4 months ago

Use Custom Google Button

import { useGoogleLogin } from '@react-oauth/google';

const login = useGoogleLogin({
  onSuccess: tokenResponse => console.log(tokenResponse),
});

<MyCustomButton onClick={() => login()}>Sign in with Google 🚀</MyCustomButton>;

Thanks, but this doesn't really work because useGoogleLogin provides a tokenResponse and I need a credentialResponse for my API

Nicolasbort commented 5 days ago

@nachodeh Have you found a solution so far?

nachodeh commented 5 days ago

@Nicolasbort yeah, I stopped using this button, created my own, and implemented token retrieval in my own API. In the end it's much better this way and gives me more flexibility.

Nicolasbort commented 5 days ago

@nachodeh that's a good idea, thanks for the reply.