Enable login (without view yet)

This commit is contained in:
aldrin 2021-04-14 11:21:39 +02:00
parent a6300d0388
commit b54c523491
6 changed files with 27 additions and 1 deletions

View file

@ -62,6 +62,13 @@ export class User extends Model implements UserData {
super();
}
async login(): Promise<void> {
await super.create("token/login", {
email: this.email,
password: this.password,
});
}
async signup(): Promise<void> {
await super.create("users", { email: this.email, password: this.password });
}

View file

@ -33,6 +33,7 @@ export default class LoginForm extends Vue {
private async doSignup() {
await this.user.signup();
// TODO: error handling, show confirmation page
}
}
</script>