diff --git a/src/authd.cr b/src/authd.cr index cf3d533..4823c7e 100644 --- a/src/authd.cr +++ b/src/authd.cr @@ -318,7 +318,7 @@ module AuthD end end - def get_user?(login : String, password : String) : Passwd::User? + def get_user?(login : String, password : String) : AuthD::User::Public? send Request::GetUserByCredentials.new login, password response = Response.from_ipc read diff --git a/src/token.cr b/src/token.cr index 4427251..5c8d844 100644 --- a/src/token.cr +++ b/src/token.cr @@ -17,13 +17,11 @@ class AuthD::Token end def to_s(key) - JWT.encode to_h.to_json, key, JWT::Algorithm::HS256 + JWT.encode to_h, key, JWT::Algorithm::HS256 end def self.from_s(key, str) payload, meta = JWT.decode str, key, JWT::Algorithm::HS256 - puts "PAYLOAD BELOW, BEWARE" - pp! payload self.new payload["login"].as_s, payload["uid"].as_i end