Skip to content

Conversation

@thanhnh2-miichisoft
Copy link

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Mar 29, 2024

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

@vercel
Copy link

vercel bot commented Mar 29, 2024

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

@taylorjdawson
Copy link

taylorjdawson commented Sep 12, 2024

@oobohP @MomenSherif can this get merged in?

@redoncordoor
Copy link

@taylorjdawson can you please merge it?

@taylorjdawson
Copy link

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

@eyueldk
Copy link

eyueldk commented Nov 6, 2024

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

@elsemk
Copy link

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 (


<div
className={'btn-primary flex-center-center'}
onClick={handleClickGoogle}
>

Google


);
};

export default Login;
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants