From 8b70374de69fa06eb2dab2bebc140235021f3915 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 15 Apr 2021 09:31:03 +0200 Subject: [PATCH] Add confirmation view --- src/api.ts | 10 +++++++--- src/components/Navbar.vue | 2 +- src/router/index.ts | 11 ++++------- src/views/About.vue | 5 ----- src/views/Home.vue | 22 ++++++++++++++++++++-- 5 files changed, 32 insertions(+), 18 deletions(-) delete mode 100644 src/views/About.vue diff --git a/src/api.ts b/src/api.ts index 9d349fd..51c6a17 100644 --- a/src/api.ts +++ b/src/api.ts @@ -32,7 +32,7 @@ class Model { } } - protected async create(endpoint: string, data: any) { + static async create(endpoint: string, data: any) { const init = { headers: new Headers(), method: "post", @@ -62,14 +62,18 @@ export class User extends Model implements UserData { super(); } + static async confirm(uid: string, token: string): Promise { + await super.create("users/activation", { uid, token }); + } + async login(): Promise { - await super.create("token/login", { + await Model.create("token/login", { email: this.email, password: this.password, }); } async signup(): Promise { - await super.create("users", { email: this.email, password: this.password }); + await Model.create("users", { email: this.email, password: this.password }); } } diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 840640f..2c82afb 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -3,7 +3,7 @@