From dbb4486fb106da8135d46b660ded8a027dcd0bf7 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Sun, 7 Jul 2024 20:02:19 +0200 Subject: [PATCH] Send email addresses on login. --- src/requests/login.cr | 3 ++- src/responses/login.cr | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/requests/login.cr b/src/requests/login.cr index b7625c7..669ba3a 100644 --- a/src/requests/login.cr +++ b/src/requests/login.cr @@ -11,7 +11,8 @@ class AuthD::Request # On successuful connection: store the authenticated user in a hash. authd.logged_users[fd] = user.to_public - Response::Login.new (token.to_s authd.configuration.secret_key), user.uid + Response::Login.new (token.to_s authd.configuration.secret_key), user.uid, + user.contact.email, user.contact.pending_email end IPC::JSON.message Login, 0 do diff --git a/src/responses/login.cr b/src/responses/login.cr index 493ddaf..413da88 100644 --- a/src/responses/login.cr +++ b/src/responses/login.cr @@ -2,7 +2,9 @@ class AuthD::Response IPC::JSON.message Login, 1 do property uid : UInt32 property token : String - def initialize(@token, @uid) + property current_email : String? = nil + property pending_email : String? = nil + def initialize(@token, @uid, @current_email, @pending_email) end end AuthD.responses << Login