From ae5360386a70a423897c0420a7a2378f97686c7d Mon Sep 17 00:00:00 2001 From: Erik Roemmelt Date: Tue, 23 Jul 2019 13:31:39 +0200 Subject: [PATCH] Session object deletion on logout; --- public/routes/auth.js | 25 ++++++++------- server/authorization.js | 69 ++++++++++++++++++++++++----------------- server/dbs.js | 2 ++ 3 files changed, 55 insertions(+), 41 deletions(-) diff --git a/public/routes/auth.js b/public/routes/auth.js index 273d925..924e92f 100644 --- a/public/routes/auth.js +++ b/public/routes/auth.js @@ -1,8 +1,8 @@ function clearAuthState() { auth.user = ''; // Login name auth.name = ''; // Full name - auth.type = ''; // type of login (domain specific) auth.mail = ''; // Full mail address + auth.type = ''; // type of login (domain specific) auth.roles = {}; // Role authorizations e.g. {user: true} auth.gender = ''; // Gender (e.g. Frau) auth.abos = []; // Followed tags @@ -24,15 +24,16 @@ function updateUserInDB() { $.ajax({ url: "api/usr", data: { + _id: auth.user, + name: auth.name, + mail: auth.mail, + type: auth.type, + gender: auth.gender, + roles: JSON.stringify(auth.roles), abos: JSON.stringify(auth.abos), bookmarks: JSON.stringify(auth.bookmarks), - mail: auth.mail, - name: auth.name, - _id: auth.user, - roles: JSON.stringify(auth.roles), - type: auth.type, }, - method: "POST" + method: "PUT" }).done(successful_save).fail(failed_save); function successful_save(res) { @@ -74,7 +75,7 @@ Vue.component('login-panel', { Eingeloggt bleiben -
Versuche es nochmal.
+
Versuche es nochmal.