Class: Oa2c::AccessToken
- Inherits:
-
Object
- Object
- Oa2c::AccessToken
- Includes:
- Mongoid::Document, OAuth2Token
- Defined in:
- app/models/oa2c/access_token.rb
Instance Method Summary collapse
Methods included from OAuth2Token
Instance Method Details
#to_bearer_token(with_refresh_token = false) ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/models/oa2c/access_token.rb', line 9 def to_bearer_token(with_refresh_token = false) Rack::OAuth2::AccessToken::Bearer.new(access_token: token, expires_in: expires_in).tap do |bearer_token| if with_refresh_token bearer_token.refresh_token = create_refresh_token(user: user, client: client).token end end end |