mirror of
https://github.com/hexahigh/portfolio.git
synced 2025-12-12 03:25:06 +01:00
save me google
This commit is contained in:
parent
c4c62d0d87
commit
61a66ad88d
@ -42,7 +42,26 @@ const auth = getAuth(app);
|
||||
const provider = new GoogleAuthProvider()
|
||||
const analytics = getAnalytics(app);
|
||||
|
||||
getRedirectResult(auth)
|
||||
.then((result) => {
|
||||
// This gives you a Google Access Token. You can use it to access Google APIs.
|
||||
const credential = GoogleAuthProvider.credentialFromResult(result);
|
||||
const token = credential.accessToken;
|
||||
|
||||
// The signed-in user info.
|
||||
const user = result.user;
|
||||
// IdP data available using getAdditionalUserInfo(result)
|
||||
// ...
|
||||
}).catch((error) => {
|
||||
// Handle Errors here.
|
||||
const errorCode = error.code;
|
||||
const errorMessage = error.message;
|
||||
// The email of the user's account used.
|
||||
const email = error.customData.email;
|
||||
// The AuthCredential type that was used.
|
||||
const credential = GoogleAuthProvider.credentialFromError(error);
|
||||
// ...
|
||||
});
|
||||
|
||||
|
||||
/*function signUp() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user