Sha256: 47702cbf57ba82b66a6e7806dc53ac88d3b17b25d09903261a8885d0f4acf30f
Contents?: true
Size: 646 Bytes
Versions: 4
Compression:
Stored size: 646 Bytes
Contents
require 'devise/oauth2_providable/strategies/oauth2_grant_type_strategy' module Devise module Strategies class Oauth2AuthorizationCodeGrantTypeStrategy < Oauth2GrantTypeStrategy def grant_type 'authorization_code' end def authenticate! if client && code = client.authorization_codes.find_by_token(params[:code]) success! code.user elsif !halted? oauth_error! :invalid_grant, 'invalid authorization code request' end end end end end Warden::Strategies.add(:oauth2_authorization_code_grantable, Devise::Strategies::Oauth2AuthorizationCodeGrantTypeStrategy)
Version data entries
4 entries across 4 versions & 1 rubygems