Skip to content

Instantly share code, notes, and snippets.

@bretanac93
Last active September 13, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bretanac93/203ccad111ae2fe153ae20c7e82ffa20 to your computer and use it in GitHub Desktop.
Save bretanac93/203ccad111ae2fe153ae20c7e82ffa20 to your computer and use it in GitHub Desktop.
<template>
<section class="container">
<a href="https://github.com/login/oauth/authorize?scope=user:email&client_id=87d59a5fead575683be3">Login with Github</a>
</section>
</template>
<script>
export default {
components: {
},
mounted() {
const {code} = this.$route.query; // Retrieve the code provided by the OAuth provider
if (code) {
this.$axios.get(`http://localhost:3000/auth/github?code=${code}`) // Send it to your server
.then((resp) => {
console.log(resp.data); // Check your console :)
})
.catch((err) => {
console.log(err);
})
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment