Class: Devise::Oauth2Providable::Client

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/devise/oauth2_providable/client.rb

Instance Method Summary collapse

Instance Method Details

#expire_tokens_for_user(user) ⇒ Object



12
13
14
15
# File 'app/models/devise/oauth2_providable/client.rb', line 12

def expire_tokens_for_user(user)
  access_tokens.where(user_id: user.id).where('expires_at > ?', Time.zone.now).update_all(expires_at: Time.zone.now)
  refresh_tokens.where(user_id: user.id).where('expires_at > ?', Time.zone.now).update_all(expires_at: Time.zone.now)
end