From 0f1cd98a80a476c81c58641a1721a2a34a08ea38 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 2 Aug 2021 14:25:58 +0200 Subject: [PATCH] feat: Add trust bridge and user activation --- src/api.ts | 9 +++--- src/components/UserTable.vue | 26 +++++------------ userausfall/admin.py | 3 +- .../migrations/0010_auto_20210802_1131.py | 29 +++++++++++++++++++ userausfall/migrations/0011_trustbridge.py | 23 +++++++++++++++ userausfall/models.py | 28 ++++-------------- userausfall/rest_api/views.py | 6 ++-- userausfall/signals.py | 6 ++-- 8 files changed, 78 insertions(+), 52 deletions(-) create mode 100644 userausfall/migrations/0010_auto_20210802_1131.py create mode 100644 userausfall/migrations/0011_trustbridge.py diff --git a/src/api.ts b/src/api.ts index 24edc12..eea769e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -43,12 +43,14 @@ export class User { email: string | undefined; password: string | undefined; username: string | null = null; - confidantEmail: string | null = null; isAuthenticated = false; + isTrusted = false; private token = ""; - static async confirm(uid: string, token: string): Promise { - await api_request("POST", "users/activation", 204, { uid, token }); + async activate(): Promise { + await api_request("POST", "users/activate", 204, { + password: this.password, + }); } async login(): Promise { @@ -84,7 +86,6 @@ export class User { 200, { username: this.username, - confidant_email: this.confidantEmail, }, this.token ); diff --git a/src/components/UserTable.vue b/src/components/UserTable.vue index 51e9491..2a98ae1 100644 --- a/src/components/UserTable.vue +++ b/src/components/UserTable.vue @@ -1,20 +1,8 @@