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