react-oauth
react-oauth copied to clipboard
Credentials JWT, auth flow for useGoogleLogin hook
Do you think it would be possible to add a optional refs to your GoogleLogin component which flow gives the JWT token
allowing very similar behavior, we can hide the button that is iframed by google, put our own custom button on top and use that when the user clicks our div/button it will give the illusion that our button is the Login with google
this would reduce the overhead needed to call additional apis or exchange auth code's with google on the backend
it would look something like this
<div>
<div style={{ display: "none" }}>
<GoogleLogin
ref={googleLoginBtnRef}
onSuccess={credentialResponse => {
console.log(credentialResponse);
// Handle authentication success
}}
onError={() => {
console.log("Login Failed");
// Handle login error
}}
/>
</div>
<StyledNormalButton
onClick={onCustomButtonClick} // Trigger Google login when your custom button is clicked
role='link'
label={label}
variant='rounded-outlined'
type='button'
leftIcon={
<Image
width={32}
height={32}
src={`${basePath}/assets/images/google-login.svg`}
alt={label}
/>
}
/>
</div>
```
most awaited component prop
This will not work because the browser prevents access to the iframe's content due to the cross-domain policy.