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