react-oauth icon indicating copy to clipboard operation
react-oauth copied to clipboard

fix id token

Open thanhnh2-miichisoft opened this issue 1 year ago • 7 comments

thanhnh2-miichisoft avatar Mar 29 '24 08:03 thanhnh2-miichisoft

⚠️ 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

changeset-bot[bot] avatar Mar 29 '24 08:03 changeset-bot[bot]

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

vercel[bot] avatar Mar 29 '24 08:03 vercel[bot]

@oobohP @MomenSherif can this get merged in?

taylorjdawson avatar Sep 12 '24 23:09 taylorjdawson

@taylorjdawson can you please merge it?

redoncordoor avatar Oct 18 '24 13:10 redoncordoor

@redoncordoor I wish I could but I am not a maintainer so I am unable to merge. You'd need to ping @MomenSherif

taylorjdawson avatar Oct 18 '24 22:10 taylorjdawson

@MomenSherif Can you please review this change and merge it?

eyueldk avatar Nov 06 '24 14:11 eyueldk

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; `

elsemk avatar Jan 16 '25 12:01 elsemk