Fixes an error client.
parent
c605c9fadf
commit
e8ace8a6eb
|
@ -318,7 +318,7 @@ module AuthD
|
||||||
end
|
end
|
||||||
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
|
send Request::GetUserByCredentials.new login, password
|
||||||
|
|
||||||
response = Response.from_ipc read
|
response = Response.from_ipc read
|
||||||
|
|
|
@ -17,13 +17,11 @@ class AuthD::Token
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s(key)
|
def to_s(key)
|
||||||
JWT.encode to_h.to_json, key, JWT::Algorithm::HS256
|
JWT.encode to_h, key, JWT::Algorithm::HS256
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.from_s(key, str)
|
def self.from_s(key, str)
|
||||||
payload, meta = JWT.decode str, key, JWT::Algorithm::HS256
|
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
|
self.new payload["login"].as_s, payload["uid"].as_i
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue