Skip to content
Snippets Groups Projects
Commit 38b695a2 authored by Antoine Rochebois's avatar Antoine Rochebois
Browse files

minor

parent 465084c4
No related branches found
No related tags found
No related merge requests found
<template>
<div class="content page-wrapper">
<div class="content-wrapper">
<nav class="navbar is-fixed-top">
<nav class="navbar is-fixed-top mb-6">
<div class="navbar-brand">
<a class="navbar-item"
><router-link to="/"><i class="fas fa-home" /> Home</router-link></a
......@@ -74,7 +74,7 @@
</nav>
<transition name="fade">
<router-view class="section"></router-view>
<router-view class="section container is-widescreen mt-6"></router-view>
</transition>
</div>
......@@ -96,6 +96,14 @@ export default {
created() {
this.usbNfcReader = new UsbNfcReader();
},
mounted() {
let uri = "//localhost:3000/loginCheck";
this.axios.post(uri, {}, { withCredentials: true }).then(response => {
console.log(response);
if (response.data != "ok")
this.$store.commit("logout");
});
},
methods: {
logout() {
let uri = "//localhost:3000/logout";
......
......@@ -60,7 +60,7 @@ export default class UsbNfcReader {
console.log("Reçu :" + msg);
let cmdIdentifier = msg.split('_')[0]
if (msg == "RECEIVED_GETID;") {
console.log("yay ! bien reçu !")
console.log("GETID request ACK by Arduino")
} else if (cmdIdentifier == "UID" && msg.slice(-1) == ';') {
resolve(msg.split('_')[1].slice(0, -1))
} else {
......
......@@ -68,6 +68,14 @@ app.post('/register', function(req, res) {
})
app.post('/loginCheck', function(req, res) {
if (req.user) {
res.send('ok')
} else {
res.send('failed')
}
})
//Initialisation
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
......
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