app/models/devise_token_auth/concerns/user.rb
# allow batch requests to use the previous token
allow batch requests to use the previous token
allow batch requests to use the previous token
def token_can_be_reused?(token, client_id)
    return true if (
      self.tokens[client_id]['updated_at'] and
      self.tokens[client_id]['last_token'] and
      self.tokens[client_id]['updated_at'] > Time.now - DeviseTokenAuth.batch_request_buffer_throttle and
      BCrypt::Password.new(self.tokens[client_id]['last_token']) == token
    )
  end
def token_can_be_reused? ( token , client_id ) return true if ( self . tokens [ client_id ] [ 'updated_at' ] and self . tokens [ client_id ] [ 'last_token' ] and self . tokens [ client_id ] [ 'updated_at' ] > Time . now - DeviseTokenAuth . batch_request_buffer_throttle and BCrypt :: Password . new ( self . tokens [ client_id ] [ 'last_token' ] ) == token ) end
allow batch requests to use the previous token
allow batch requests to use the previous token
# ensure that the last token and its creation time exist # ensure that previous token falls within the batch buffer throttle time of the last request # ensure that the token is valid
token
<not_specific>
client_id
<not_specific>