From e1567258f499678b456e05c7ab26e48ab2f68ac1 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Sat, 25 Apr 2020 10:34:07 +0200 Subject: [PATCH] Token responses send the UID as well. --- src/authd.cr | 3 ++- src/main.cr | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/authd.cr b/src/authd.cr index a6540d4..b85e1b8 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -55,9 +55,10 @@ class AuthD::Response end class Token < Response + property uid : Int32 property token : String - initialize :token + initialize :token, :uid end class User < Response diff --git a/src/main.cr b/src/main.cr index 8c513b6..5db8ebc 100644 --- a/src/main.cr +++ b/src/main.cr @@ -71,7 +71,7 @@ class AuthD::Service # change the date of the last connection @users_per_uid.update user.uid.to_s, user - Response::Token.new token.to_s @jwt_key + Response::Token.new (token.to_s @jwt_key), user.uid when Request::AddUser # No verification of the users' informations when an admin adds it. # No mail address verification.