File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,8 @@ Syntax : `$auth.loginWithEmailAndPassword(object)`
298
298
299
299
Allow the users to authenticate to Firebase using their ** Google accounts** .
300
300
301
- Syntax : ` $auth.signInWithGoogle(object) `
301
+ Syntax : ` $auth.signInWithGoogle() `
302
+ Return : ` Promise `
302
303
303
304
##### Example
304
305
@@ -314,15 +315,11 @@ Syntax : `$auth.signInWithGoogle(object)`
314
315
export default {
315
316
mounted () {
316
317
// Check if the user signed in with redirection.
317
- this .$auth .state ({
318
- forward: ' /app' ,
319
- redirect: ' /login' ,
320
- then : (user ) => {
321
- //
322
- },
323
- catch : (error ) => {
324
- console .log (error .message )
325
- }
318
+ this .$auth .state (' /app' , ' /login' )
319
+ .then ((user ) => {
320
+ // user signed-in
321
+ }).catch (error => {
322
+ console .log (error .message )
326
323
})
327
324
},
328
325
data () {
@@ -332,15 +329,12 @@ Syntax : `$auth.signInWithGoogle(object)`
332
329
methods: {
333
330
signInWithGoogle () {
334
331
// SignIn with google
335
- this .$auth .signInWithGoogle ({
336
- result : (user ) => {
337
- // This gives you a Google Access Token. You can use it to access the Google API.
338
- // The signed-in user info.
339
- },
340
- error : (error ) => {
341
- console .log (error .message )
342
- }
343
- });
332
+ this .$auth .signInWithGoogle ()
333
+ .then (user => {
334
+
335
+ }).catch (error => {
336
+
337
+ })
344
338
}
345
339
}
346
340
}
You can’t perform that action at this time.
0 commit comments