File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -99,14 +99,20 @@ initializeApp() {
9999sign in function
100100
101101``` ts
102+ import { GoogleAuth } from " @codetrix-studio/capacitor-google-auth" ;
103+ import { Auth , GoogleAuthProvider , signInWithCredential } from ' @angular/fire/auth' ;
104+
102105async googleSignIn () {
103106 let googleUser = await GoogleAuth .signIn ();
104107
105108 /*
106109 If you use Firebase you can forward and use the logged in Google user like this:
107110 */
108- const credential = auth .GoogleAuthProvider .credential (googleUser .authentication .idToken );
109- return this .afAuth .auth .signInAndRetrieveDataWithCredential (credential );
111+ constructor (private auth : Auth ){}
112+
113+ const googleUser = await GoogleAuth .signIn ();
114+ const _credential = GoogleAuthProvider .credential (googleUser .authentication .idToken );
115+ return signInWithCredential (this .auth , _credential );
110116}
111117```
112118
You can’t perform that action at this time.
0 commit comments