started the authentication

basic routing
This commit is contained in:
Torben Indorf
2020-02-09 09:48:43 +01:00
parent d07dc6e8a6
commit e2568a1bbe
19 changed files with 326 additions and 61 deletions
+39
View File
@@ -0,0 +1,39 @@
<template>
<div>
<div>
<ion-button @click="loginClicked">Login</ion-button>
</div>
</div>
</template>
<script lang="ts">
import {Component, Vue} from "vue-property-decorator";
import { namespace } from 'vuex-class';
const AuthStore = namespace('auth');
@Component
export default class LoginView extends Vue {
@AuthStore.Action('loginAction')
public login!: (payload: { email: string, password: string }) => any;
public async loginClicked() {
const response = await this.login({
email: 't.indorf@28apps.de',
password: 'test'
});
if (response.status === 200) {
await this.$router.push({name: 'areaSelection'});
} else {
// TODO: Show error!
}
}
}
</script>
<style scoped>
</style>