This commit is contained in:
@@ -41,7 +41,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
performLogin() {
|
||||
this.$store.dispatch("performLogin", this.creds).then(() => {
|
||||
this.$store.dispatch("auth/performLogin", this.creds).then(() => {
|
||||
this.$router.push({name: 'Dashboard'});
|
||||
}).catch(() => {
|
||||
this.invalidLogin = true;
|
||||
@@ -52,14 +52,14 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['authInProgress'])
|
||||
...mapGetters('auth', ['authInProgress'])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.text-alert {
|
||||
color: red;
|
||||
color: red !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
<md-card-actions>
|
||||
<md-progress-spinner :md-diameter="30" :md-stroke="3" md-mode="indeterminate" v-if="authInProgress"
|
||||
class="md-accent"></md-progress-spinner>
|
||||
<md-button type="submit" class="md-primary" :disabled="authInProgress && passwordGood">Register</md-button>
|
||||
<md-button type="submit" class="md-primary" :disabled="authInProgress || !passwordGood">Register
|
||||
</md-button>
|
||||
</md-card-actions>
|
||||
</form>
|
||||
</div>
|
||||
@@ -46,13 +47,13 @@ export default {
|
||||
methods: {
|
||||
performRegister() {
|
||||
const creds = {name: this.form.name, password: this.form.password};
|
||||
this.$store.dispatch("performRegister", creds).then(() => {
|
||||
this.$store.dispatch("auth/performRegister", creds).then(() => {
|
||||
this.$router.push({name: 'Dashboard'});
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['authInProgress']),
|
||||
...mapGetters('auth', ['authInProgress']),
|
||||
passwordGood() {
|
||||
return this.form.password !== "" && this.form.password === this.form.passwordConfirm;
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
<md-list>
|
||||
<md-list-item>
|
||||
<md-avatar class="md-avatar-icon">J</md-avatar>
|
||||
<span class="md-list-item-text">Joska</span>
|
||||
<md-avatar class="md-avatar-icon">{{ avatarText }}</md-avatar>
|
||||
<span class="md-list-item-text">{{ $store.state.auth.name }}</span>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item>
|
||||
@@ -26,10 +26,15 @@ export default {
|
||||
name: "WorkspaceDrawerContent",
|
||||
methods: {
|
||||
performLogout() {
|
||||
this.$store.dispatch("performLogout").then(() => {
|
||||
this.$store.dispatch("auth/performLogout").then(() => {
|
||||
this.$router.push({name: "Welcome"})
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
avatarText() {
|
||||
return this.$store.state.auth.name.slice(0,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user