Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"graphql": "^0.11.7",
"graphql-request": "^1.4.0",
"graphql-tag": "^2.5.0",
"hellojs": "^1.17.1",
"heroku-ssl-redirect": "0.0.4",
"is-image-url": "^1.1.8",
"just-detect-adblock": "^1.0.0",
Expand All @@ -32,6 +33,7 @@
"quasar-framework": "^0.14.4",
"vue": "^2.5.0",
"vue-coin-hive": "0.0.8",
"vue-hellojs": "0.0.4",
"vue-router": "^3.0.1",
"vuelidate": "^0.6.1"
},
Expand Down
24 changes: 24 additions & 0 deletions src/components/Auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
h6.light-paragraph.text-center(style="margin-bottom:30px;" v-if="invitedByUser && registering") You were invited by
h6.text-center {{invitedByUser.username}}
h6.light-paragraph.text-center(v-if="localAuth" style="margin-bottom:30px;") Desktop Application
div.text-center
q-icon(@click="socialAuth('google')" name="fa-google" size="2rem" style="margin:0 10px" color="blue")
q-icon(@click="socialAuth('twitter')" name="fa-twitter" size="2rem" style="margin:0 10px" color="blue")
div
q-input(
v-model="form.email"
Expand Down Expand Up @@ -137,6 +140,27 @@ export default {
})
}
},
socialAuth(network) {
const hello = this.hello;
hello(network).login({
scope: 'email',
force: true,
auth_type: 'rerequest'
}).then(() => {
const authRes = hello(network).getAuthResponse();
/*
performs operations using the token from authRes
*/
console.log(authRes.access_token);
hello(network).api('me').then(function (json) {
const profile = json;
console.log(profile);
/*
performs operations using the user info from profile
*/
});
})
},
checkInvitedBy: async function() {
console.log(this.$route)

Expand Down
10 changes: 10 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ import 'quasar-extras/material-icons'
import 'quasar-extras/fontawesome'
// import 'quasar-extras/animate'

const HelloJs = require('hellojs/dist/hello.all.min.js');
const VueHello = require('vue-hellojs');

HelloJs.init({
google: '474818646334-kgl6rsvpflvksrev5c0jvh6eem1dd9aj.apps.googleusercontent.com'
}, {
redirect_uri: 'authcallback/'
});
Vue.use(VueHello, HelloJs);

Quasar.start(() => {
/* eslint-disable no-new */
new Vue({
Expand Down