Fix signup cycle (signup, confirm, login)

This commit is contained in:
aldrin 2021-04-16 11:08:28 +02:00
parent 6e4c2ddabd
commit fbb4e4502e
3 changed files with 20 additions and 17 deletions

View file

@ -8,15 +8,7 @@
<UserTable :user="user" />
</div>
<div v-else class="column is-3-widescreen is-4-desktop is-5-tablet">
<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>
<LoginForm v-else :user="user" />
<LoginForm :user="user" />
</div>
</div>
</section>
@ -30,13 +22,17 @@ import UserTable from "@/components/UserTable.vue";
@Component({ components: { UserTable, LoginForm } })
export default class Home extends Vue {
private isConfirmation = false;
private user = new User();
public async created(): Promise<void> {
if (this.$route.name === "confirm") this.isConfirmation = true;
if (this.isConfirmation) {
if (this.$route.name === "confirm") {
await User.confirm(this.$route.params.uid, this.$route.params.token);
this.$router.push({ name: "login" });
this.$buefy.toast.open({
message:
"Deine E-Mail-Adresse wurde bestätigt. Du kannst dich nun anmelden.",
type: "is-success",
});
}
}
}