From 313536f996cbdd31eb4e62621c141ae81a4b82e7 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Mon, 17 Dec 2018 12:39:01 +0900 Subject: [PATCH] Variable naming. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some breaking changes in the communications with authd (some request attributes renamed), but projects using AuthD::Client shouldn’t see anything. --- src/authd.cr | 6 +++--- src/main.cr | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/authd.cr b/src/authd.cr index c36f65d..7d2575d 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -20,7 +20,7 @@ module AuthD class GetTokenRequest JSON.mapping({ # FIXME: Rename to "login" for consistency. - username: String, + login: String, password: String }) end @@ -34,9 +34,9 @@ module AuthD initialize "auth" end - def get_token?(username : String, password : String) + def get_token?(login : String, password : String) send RequestTypes::GET_TOKEN.value.to_u8, { - :username => username, + :login => login, :password => password }.to_json diff --git a/src/main.cr b/src/main.cr index 381e676..b49d068 100644 --- a/src/main.cr +++ b/src/main.cr @@ -59,7 +59,7 @@ IPC::Service.new "auth" do |event| next end - user = passwd.get_user request.username, request.password + user = passwd.get_user request.login, request.password if user.nil? client.send ResponseTypes::INVALID_CREDENTIALS.value.to_u8, ""