Skip to content

Instantly share code, notes, and snippets.

@iamparthaonline
Last active September 17, 2022 03:18
Show Gist options
  • Select an option

  • Save iamparthaonline/f8b0c4018fd15f1bf3d3b42ca33785ee to your computer and use it in GitHub Desktop.

Select an option

Save iamparthaonline/f8b0c4018fd15f1bf3d3b42ca33785ee to your computer and use it in GitHub Desktop.
<template>
<div class="app">
<button
:disabled="loading || !configurationExists"
@click="login"
>
{{ ( loading || !configurationExists ) ? 'Please wait' : 'Continue with Google' }}
</button>
</div>
</template>
<script>
export default {
meteor: {
configurationExists() {
return ServiceConfiguration.configurations.findOne({service: 'google'});
},
},
components: {},
props: {
loginData: {
type: Object,
},
},
data() {
return {
loading: false,
};
},
methods: {
login() {
this.loading = true;
Meteor.loginWithGoogle(err => {
if (!err) {
// successful authentication
this.$router.push({name: 'dashboard'});
} else{
// failed authentication
alert(err.toString() || 'Unknown Error');
}
});
},
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment