started the authentication
basic routing
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user