From 25361bf7aa28ba6661ff073b6688b7a6940a291d Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Sat, 26 Sep 2020 14:27:47 +0200 Subject: [PATCH] Fixes auth-user-add. --- src/authd.cr | 4 ++-- utils/authd-user-add.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authd.cr b/src/authd.cr index 1954dc6..036d63d 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -448,7 +448,7 @@ module AuthD def add_user(login : String, password : String, email : String?, phone : String?, - profile : JSON::Any?) : ::AuthD::User::Public | Exception + profile : Hash(String, JSON::Any)?) : ::AuthD::User::Public | Exception send Request::AddUser.new @key, login, password, email, phone, profile @@ -513,7 +513,7 @@ module AuthD password : String, email : String?, phone : String?, - profile : JSON::Any?) : ::AuthD::User::Public? + profile : Hash(String, JSON::Any)?) : ::AuthD::User::Public? send Request::Register.new login, password, email, phone, profile response = Response.from_ipc read diff --git a/utils/authd-user-add.cr b/utils/authd-user-add.cr index 4028f37..9ecf8b3 100644 --- a/utils/authd-user-add.cr +++ b/utils/authd-user-add.cr @@ -53,7 +53,7 @@ login = cli_login.not_nil! # not_nil!? O RLY? profile = profile_file.try do |file| begin - JSON.parse File.read file + JSON.parse(File.read file).as_h rescue e STDERR.puts e.message exit 1