fix id token
⚠️ No Changeset found
Latest commit: 7f71538b0d79dbd46012aa593975f869c5bb8a28
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-oauth | ⬜️ Ignored (Inspect) | Visit Preview | Mar 29, 2024 8:12am |
@oobohP @MomenSherif can this get merged in?
@taylorjdawson can you please merge it?
@redoncordoor I wish I could but I am not a maintainer so I am unable to merge. You'd need to ping @MomenSherif
@MomenSherif Can you please review this change and merge it?
Tested and available
` import React from 'react'; import GoogleIcon from '@/assets/common/google-icon.png'; import { useAsyncEffect, useMemoizedFn } from 'ahooks'; import { googleClientId } from '@/utils/global';
import { gapi, loadGapiInsideDOM } from 'gapi-script';
const Login = () => { useAsyncEffect(async () => { const gapi = await loadGapiInsideDOM(); gapi.load('auth2', function () { gapi.auth2.init({ client_id: googleClientId, }); }); }, []);
const handleClickGoogle = useMemoizedFn(() => { const auth2 = gapi.auth2.getAuthInstance(); auth2.signIn().then(function (googleUser: any) { const googleInfo = googleUser.getAuthResponse(); console.log(googleInfo, '===='); const id_token = googleInfo.id_token; if (id_token) { // todo } }); });
return ( <div className="h-full overflow-x-hidden bg-[#E5B5E7] pt-[15%] relative max-w-450"> <div className={'btn-primary flex-center-center'} onClick={handleClickGoogle} > <img width={24} height={24} className="mr-10" src={GoogleIcon} /> Google ); };
export default Login; `