Skip to content

Instantly share code, notes, and snippets.

@rkpattnaik780
Created August 6, 2019 04:41
Show Gist options
  • Save rkpattnaik780/461ebbd7fb20faaaca160bf593f8b5a2 to your computer and use it in GitHub Desktop.
Save rkpattnaik780/461ebbd7fb20faaaca160bf593f8b5a2 to your computer and use it in GitHub Desktop.
client/src/components/HelloWorld.vue
<template>
<div class="hello">
<a href="http://localhost:3000/auth/github">
<button>Sign-In With Github</button>
</a>
</div>
</template>
<script>
import axios from "axios";
export default {
name: 'HelloWorld',
mounted(){
// to get the cookie data whenever component is mounted.
this.checkIfLoggedIn()
},
methods: {
checkIfLoggedIn() {
axios
.get('http://localhost:3000/auth/check')
.then(response => {
console.log(response.data);
});
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment