-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
구글 로그인 라이브러리 최신화 구글로그인 컴포넌트를 logins폴더에 생성 Issues #15
- Loading branch information
김병현
authored and
김병현
committed
Sep 12, 2023
1 parent
8daf55c
commit 04842c0
Showing
4 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { GoogleOAuthProvider, GoogleLogin, useGoogleOneTapLogin } from '@react-oauth/google'; | ||
|
||
const GoogleSignInComponent: React.FC = () => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const handleSuccess = (credentialResponse: any) => { | ||
console.log(credentialResponse); | ||
}; | ||
|
||
const handleError = () => { | ||
console.log('Login Failed'); | ||
}; | ||
|
||
// One-tap 로그인 (선택적) | ||
useGoogleOneTapLogin({ | ||
onSuccess: handleSuccess, | ||
onError: handleError, | ||
}); | ||
|
||
return ( | ||
<GoogleOAuthProvider clientId=" | ||
690344785644-2oj84rcukd2rhu3o56gbq6rahap16m37.apps.googleusercontent.com"> | ||
<GoogleLogin | ||
onSuccess={handleSuccess} | ||
onError={handleError} | ||
useOneTap | ||
/> | ||
</GoogleOAuthProvider> | ||
); | ||
}; | ||
|
||
export default GoogleSignInComponent; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters