From b5d1a417de2d4aab6c4396058e056e004dfaa4b6 Mon Sep 17 00:00:00 2001 From: Evert Date: Sat, 18 Nov 2017 10:59:49 +0200 Subject: [PATCH] Add UUID to admin panel, make avatars fetchable by UUID --- server/api/admin.js | 1 + server/api/index.js | 2 ++ views/admin/index.pug | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/api/admin.js b/server/api/admin.js index 7f56c1c..cbc9b98 100644 --- a/server/api/admin.js +++ b/server/api/admin.js @@ -8,6 +8,7 @@ function cleanUserObject (dbe, admin) { id: dbe.id, username: dbe.username, display_name: dbe.display_name, + uuid: dbe.uuid, email: dbe.email, avatar_file: dbe.avatar_file, activated: dbe.activated === 1, diff --git a/server/api/index.js b/server/api/index.js index 8ee6276..028531d 100644 --- a/server/api/index.js +++ b/server/api/index.js @@ -123,6 +123,8 @@ const API = { scope = 'username' if (identifier.indexOf('@') !== -1) { scope = 'email' + } else if (identifier.length === 36 && identifier.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)) { + scope = 'uuid' } } else if (typeof identifier === 'object') { if (identifier.id != null) { diff --git a/views/admin/index.pug b/views/admin/index.pug index 885ff86..2b40f12 100644 --- a/views/admin/index.pug +++ b/views/admin/index.pug @@ -30,7 +30,7 @@ block body {{/activated}}
{{display_name}}
-
{{id}} - {{username}}
+
{{id}} - {{username}} ({{uuid}})
{{email}}
Privilege: level {{nw_privilege}}
{{created_at}}