Logout function not working ' Uncaught TypeError: google_logout is not a function '
Error : Logout function not working ' Uncaught TypeError: google_logout is not a function '
code example custom logout button ` import { googleLogout } from '@react-oauth/google';
return (
<button onClick={() => login()}>
Sign in with Google ๐{' '}
</button>;
<button onClick={() => googleLogout}> Logout Google ๐{' '} ;
</GoogleOAuthProvider>
</div>
); `
googleLogout itself is a function it doesn't return anything so your variable is undefined
You need to call it directly on the button
@MomenSherif here is code but still not logout no any response
<button onClick={() => googleLogout}> Logout Google ๐{' '} </button>
<button onClick={() => googleLogout()}> Logout Google ๐{' '}
@MomenSherif nothing happens when i click on Logout button. can you please suggest any debug way !
<button onClick={() => googleLogout()}> Logout Google ๐{' '}
This doesnt work. My Google Sign In button logged me in as expected and shows my email and name on the button. But when I call this API and then reload the page, the button still shows my name and email meaning that I have not been logged out. How to make this work? @MomenSherif
I have the same issue with logout. What do I wrong here? @MomenSherif
<GoogleOAuthProvider clientId='my-id'>
<GoogleLogin
onSuccess={credentialResponse => {
console.log(credentialResponse)
}}
onError={() => {
console.log('Login Failed')
}}
/>
<Button
type='button'
onClick={googleLogout}
>
Logout
</Button>
</GoogleOAuthProvider>
@jaydeepw have you fixed that?
Has anyone fixed this issue? I am still having this.
Also having this issue
provided googleLogout() is not working. the token is still valid after this method is invoked.
import { googleLogout } from '@react-oauth/google
This library has this issue which you are facing, there is no fix for this with this library as far as I know. I would recommend you to use something else, maybe firebase auth but it's all up to you.
@react-oauth/googleย library has the issue you're facing for logging out, and as far as I know, there is no fix for it within this library. I would recommend you to use something else, perhaps Firebase Authentication, but the choice is up to you. On Friday, February 2, 2024 at 02:04:51 AM PST, WaleedShahzaib @.***> wrote:
provided googleLogout() is not working. the token is still valid after this method is invoked.
โ Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>