feat: Allow to activate trusted accounts only

This commit is contained in:
aldrin 2021-08-03 11:41:58 +02:00
parent 0f1cd98a80
commit d656370aef
5 changed files with 40 additions and 44 deletions

View file

@ -27,23 +27,9 @@ export default class Home extends mixins(NotifyMixin) {
private user = new User();
public async created(): Promise<void> {
if (this.$route.name === "confirm") {
await this.doConfirm();
} else if (!this.user.isAuthenticated && this.$route.name !== "login") {
if (!this.user.isAuthenticated && this.$route.name !== "login") {
this.$router.push({ name: "login" });
}
}
private async doConfirm() {
try {
await User.confirm(this.$route.params.uid, this.$route.params.token);
this.$router.push({ name: "login" });
this.showSuccess(
"Deine E-Mail-Adresse wurde bestätigt. Du kannst dich nun anmelden."
);
} catch {
this.showError();
}
}
}
</script>