Commit 1ede4162 authored by thibaut-felten's avatar thibaut-felten

LoginNavbar

parent 178f504d
......@@ -3,10 +3,10 @@
<button class="btn-login">
<router-link to="/">Accueil</router-link>
</button>
<button class="btn-login">
<button class="btn-login" v-if="connected">
<router-link to="/inscription">Sign Up</router-link>
</button>
<button class="btn-login">
<button class="btn-login" v-if="connected">
<router-link to="/login">Log In</router-link>
</button>
......@@ -17,13 +17,14 @@
<script>
export default {
name: 'LoginNavbar',
// components: {
// 'v-icon': Icon
// }
data(){ // the data, declared as function
return{ // we return all the properties that should be react on.
connected:true
}
},
}
// import 'vue-awesome/icons'
// import Icon from 'vue-awesome/components/Icon'
</script>
<style scoped>
......
......@@ -43,7 +43,7 @@ export default {
name: 'Accueil',
components: {
LoginNavbar
}
},
}
import LoginNavbar from '../components/LoginNavbar.vue'
......
......@@ -76,6 +76,11 @@
<script>
export default {
name: 'Login',
data(connect){ // the data, declared as function
return{ // we return all the properties that should be react on.
connected:connect
}
},
methods: {
check: function(){
let login = this.login
......@@ -101,12 +106,13 @@ export default {
fetch(url, params)
.then(response=>response.json())
.then(response => {
sessionStorage.setItem("JWT_TOKEN", response.data.jwt_token)
console.log(sessionStorage.getItem("JWT_TOKEN"))
.then(data => {
sessionStorage.setItem("JWT_TOKEN", data.jwt_token)
console.log(sessionStorage.getItem("JWT_TOKEN"))
})
let connect = false
console.log(connect)
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment