Update to new crystal-jwt APIs.
parent
66e2eaad48
commit
908f028322
|
@ -119,7 +119,7 @@ module AuthD
|
|||
end
|
||||
|
||||
def decode_token(token)
|
||||
user, meta = JWT.decode token, @key, "HS256"
|
||||
user, meta = JWT.decode token, @key, JWT::Algorithm::HS256
|
||||
|
||||
user = AuthD::User.from_json user.to_json
|
||||
|
||||
|
@ -135,7 +135,6 @@ module AuthD
|
|||
|
||||
response = read
|
||||
|
||||
pp! response.type
|
||||
payload = String.new response.payload
|
||||
case ResponseTypes.new response.type.to_i
|
||||
when ResponseTypes::Ok
|
||||
|
|
|
@ -58,7 +58,6 @@ IPC::Service.new "auth" do |event|
|
|||
when IPC::Event::Message
|
||||
message = event.message
|
||||
payload = message.payload
|
||||
pp message
|
||||
|
||||
case RequestTypes.new message.type.to_i
|
||||
when RequestTypes::GetToken
|
||||
|
@ -79,7 +78,7 @@ IPC::Service.new "auth" do |event|
|
|||
end
|
||||
|
||||
client.send ResponseTypes::Ok.value.to_u8,
|
||||
JWT.encode user.to_h, authd_jwt_key, "HS256"
|
||||
JWT.encode user.to_h, authd_jwt_key, JWT::Algorithm::HS256
|
||||
when RequestTypes::AddUser
|
||||
begin
|
||||
request = AddUserRequest.from_json String.new payload
|
||||
|
|
Loading…
Reference in New Issue