File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ # vue-google-auth
2+ Handling Google sign-in and sign-out for Vue.js applications
3+
4+ ## Installation
5+ ` npm install simmatrix/vue-google-auth `
6+
7+ ## Initialization
8+ ```
9+ import GoogleAuth from 'vue-google-auth'
10+
11+ Vue.use(GoogleAuth, { clientID: 'xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com' })
12+ Vue.googleAuth().load()
13+ ```
14+ Ideally you shall put in this in your main file, e.g. main.js
15+
16+ ## Usage
17+ Handling Google sign-in, this is added within the login page
18+ ```
19+ import Vue from 'vue'
20+
21+ Vue.googleAuth().signIn(function () {
22+ // things to do when sign-in succeeds
23+ }, function () {
24+ // things to do when sign-in fails
25+ ))
26+ ```
27+
28+ Handling Google sign-out
29+ ```
30+ import Vue from 'vue'
31+
32+ Vue.googleAuth().signOut(function () {
33+ // things to do when sign-out succeeds
34+ }, function () {
35+ // things to do when sign-out fails
36+ ))
37+ ```
You can’t perform that action at this time.
0 commit comments