Created
August 6, 2019 04:41
-
-
Save rkpattnaik780/461ebbd7fb20faaaca160bf593f8b5a2 to your computer and use it in GitHub Desktop.
client/src/components/HelloWorld.vue
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> | |
<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