Commit 55cd0722 authored by quentin.vrel's avatar quentin.vrel

prevents logged users to log in or register again

parent 595b4651
......@@ -18,6 +18,11 @@ export default {
PageTitle,
ButtonText
},
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
},
methods: {
onSubmit: function(){
if (event.submitter.id=='login') {
......
......@@ -5,8 +5,6 @@
<div class="form-content">
<text-input id="login" label="Pseudo"/>
<pwd-input id="password" label="Mot de passe"/>
<checkbox-input id="remember" label="Se souvenir de moi"/>
</div>
<svg-button id="back" svg="/icons/back.svg"/>
......@@ -21,15 +19,18 @@ import PageTitle from '@/components/PageTitle.vue'
import SvgButton from '@/components/SvgButton.vue'
import TextInput from '@/components/form/TextInput.vue'
import PwdInput from '@/components/form/PwdInput.vue'
import CheckboxInput from '@/components/form/CheckboxInput.vue'
export default {
name: 'Login',
components: {
PageTitle,
SvgButton,
TextInput,
PwdInput,
CheckboxInput
PwdInput
},
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
},
data() {
return {
......
......@@ -43,6 +43,11 @@ export default {
showNotFilledError : false,
}
},
beforeCreate () {
if (localStorage.getItem('user') != null) {
this.$router.push('/lobby');
}
},
methods: {
onSubmit: async function(){
// If we press back, we go back
......
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