This repository has been archived on 2022-05-05. You can view files and clone it, but cannot push or open issues or pull requests.
userausfall/src/views/MainPage.vue

44 lines
1.3 KiB
Vue
Raw Normal View History

2021-04-13 09:06:28 +02:00
<template>
2021-04-13 11:01:50 +02:00
<section class="container">
<div class="columns is-centered">
2021-04-16 10:36:52 +02:00
<div
v-if="user.isAuthenticated"
class="column is-3-widescreen is-4-desktop is-5-tablet"
>
<UserTable :user="user" />
</div>
<div v-else class="column is-3-widescreen is-4-desktop is-5-tablet">
2021-04-15 09:31:03 +02:00
<b-notification
v-if="isConfirmation"
type="is-success"
aria-close-label="Close notification"
>
Deine E-Mail-Adresse wurde erfolgreich bestätigt. Du kannst dich nun
anmelden.
</b-notification>
2021-04-15 11:36:21 +02:00
<LoginForm v-else :user="user" />
2021-04-13 11:01:50 +02:00
</div>
</div>
</section>
2021-04-13 09:06:28 +02:00
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
2021-04-13 11:01:50 +02:00
import LoginForm from "@/components/LoginForm.vue";
2021-04-15 09:31:03 +02:00
import { User } from "@/api";
2021-04-15 11:36:21 +02:00
import UserTable from "@/components/UserTable.vue";
2021-04-13 09:06:28 +02:00
2021-04-15 11:36:21 +02:00
@Component({ components: { UserTable, LoginForm } })
2021-04-15 09:31:03 +02:00
export default class Home extends Vue {
private isConfirmation = false;
2021-04-15 16:04:22 +02:00
private user = new User();
2021-04-15 09:31:03 +02:00
2021-04-16 10:36:52 +02:00
public async created(): Promise<void> {
if (this.$route.name === "confirm") this.isConfirmation = true;
2021-04-15 09:31:03 +02:00
if (this.isConfirmation) {
await User.confirm(this.$route.params.uid, this.$route.params.token);
}
}
}
2021-04-13 09:06:28 +02:00
</script>