-
Notifications
You must be signed in to change notification settings - Fork 153
fix id token #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix id token #342
Conversation
⚠️ No Changeset found
Latest commit: 7f71538
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
|
@oobohP @MomenSherif can this get merged in?
redoncordoor
commented
Oct 18, 2024
@taylorjdawson can you please merge it?
taylorjdawson
commented
Oct 18, 2024
@redoncordoor I wish I could but I am not a maintainer so I am unable to merge. You'd need to ping @MomenSherif
eyueldk
commented
Nov 6, 2024
@MomenSherif Can you please review this change and merge it?
elsemk
commented
Jan 16, 2025
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 (
);
};
export default Login;
`
No description provided.