0
Hello,
I am programming an application using Vue.JS, (I am new to Javascript) and Mongo (Cloud Server) and I wanted to ask a question to know if my logic is correct or wrong, and if I need to improve...
When the user logs in, I save the user data by localStorage, thus:
methods() {
let api = 'localhost:3000/api/login';
axios.post(api, {
email: email,
password: password
})
.then((res) => {
var useruid = res.uid;
localStorage.setItem('logado', useruid);
this.$router.push('/dashboard');
});
}
That’s how I programmed my app. That’s right my code?
Right in what way? I see no point in using
get
for login, how the server will know which user credentials?– Denis Rudnei de Souza
It’s post, I ended up adding get in wrong place. I edited the post if you can answer thank you. Abç
– Rick
To save in localstorage after login is right, you need to configure later the
logoff
, also validate if the person is actually logged in to the backend not to see the system screen even the server sending a403
– Denis Rudnei de Souza