Skip to content

Commit

Permalink
Issue - 1358 Argument error when converting token updated_at using to…
Browse files Browse the repository at this point in the history
…_time fixed (lynndylanhurley#1388)
  • Loading branch information
saichander17 authored Apr 29, 2020
1 parent a3595f4 commit 387306a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/devise_token_auth/concerns/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def create_new_auth_token(client = nil)
token = create_token(
client: client,
last_token: tokens.fetch(client, {})['token'],
updated_at: now
updated_at: now.to_s(:rfc822)
)

update_auth_header(token.token, token.client)
Expand Down Expand Up @@ -194,7 +194,7 @@ def build_auth_url(base_url, args)
end

def extend_batch_buffer(token, client)
tokens[client]['updated_at'] = Time.zone.now
tokens[client]['updated_at'] = Time.zone.now.to_s(:rfc822)
update_auth_header(token, client)
end

Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ActiveSupport::TestCase

def age_token(user, client_id)
if user.tokens[client_id]
user.tokens[client_id]['updated_at'] = Time.zone.now - (DeviseTokenAuth.batch_request_buffer_throttle + 10.seconds)
user.tokens[client_id]['updated_at'] = (Time.zone.now - (DeviseTokenAuth.batch_request_buffer_throttle + 10.seconds)).to_s(:rfc822)
user.save!
end
end
Expand Down

0 comments on commit 387306a

Please sign in to comment.