Sha256: b53414bc41aeddc8204d36f6e14fc83f99cd6dcbbb2e4704a86df0ac576ca1ec
Contents?: true
Size: 712 Bytes
Versions: 12
Compression:
Stored size: 712 Bytes
Contents
require 'devise/oauth2_providable/strategies/oauth2_grant_type_strategy' module Devise module Strategies class Oauth2RefreshTokenGrantTypeStrategy < Oauth2GrantTypeStrategy def grant_type 'refresh_token' end def authenticate_grant_type(client) if refresh_token = client.refresh_tokens.find_by_token(params[:refresh_token]) env[Devise::Oauth2Providable::REFRESH_TOKEN_ENV_REF] = refresh_token success! refresh_token.user else oauth_error! :invalid_grant, 'invalid refresh token' end end end end end Warden::Strategies.add(:oauth2_refresh_token_grantable, Devise::Strategies::Oauth2RefreshTokenGrantTypeStrategy)
Version data entries
12 entries across 12 versions & 6 rubygems