Skip to content

Commit 4b549e7

Browse files
committed
update auth (google)
1 parent 15c936b commit 4b549e7

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

docs/authentication.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ Syntax : `$auth.loginWithEmailAndPassword(object)`
298298

299299
Allow the users to authenticate to Firebase using their **Google accounts**.
300300

301-
Syntax : `$auth.signInWithGoogle(object)`
301+
Syntax : `$auth.signInWithGoogle()`
302+
Return : `Promise`
302303

303304
##### Example
304305

@@ -314,15 +315,11 @@ Syntax : `$auth.signInWithGoogle(object)`
314315
export default {
315316
mounted() {
316317
// 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)
326323
})
327324
},
328325
data() {
@@ -332,15 +329,12 @@ Syntax : `$auth.signInWithGoogle(object)`
332329
methods: {
333330
signInWithGoogle() {
334331
// 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+
})
344338
}
345339
}
346340
}

0 commit comments

Comments
 (0)