Last active
September 13, 2018 21:47
-
-
Save bretanac93/203ccad111ae2fe153ae20c7e82ffa20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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