Sha256: c146683300c503d1d33f2f8043584053cb948854e0a4c2e1ecd3459a8476c471

Contents?: true

Size: 674 Bytes

Versions: 13

Compression:

Stored size: 674 Bytes

Contents

class Devise::Oauth2Providable::TokensController < ApplicationController
  before_filter :authenticate_user!
  skip_before_filter :verify_authenticity_token, :only => :create

  def create
    @refresh_token = oauth2_current_refresh_token || oauth2_current_client.refresh_tokens.create!(:user => current_user)
    @access_token = @refresh_token.access_tokens.create!(:client => oauth2_current_client, :user => current_user)
    render :json => @access_token.token_response
  end
  private
  def oauth2_current_client
   env[Devise::Oauth2Providable::CLIENT_ENV_REF]
  end
  def oauth2_current_refresh_token
    env[Devise::Oauth2Providable::REFRESH_TOKEN_ENV_REF]
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
mustwin_devise_oauth2_providable-1.1.6 app/controllers/devise/oauth2_providable/tokens_controller.rb
mustwin_devise_oauth2_providable-1.1.5 app/controllers/devise/oauth2_providable/tokens_controller.rb
mustwin_devise_oauth2_providable-1.1.4 app/controllers/devise/oauth2_providable/tokens_controller.rb
mustwin_devise_oauth2_providable-1.1.3 app/controllers/devise/oauth2_providable/tokens_controller.rb
insrc_devise_oauth2_providable-1.1.2 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.1.2 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.1.1 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.1.0 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.0.5 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.0.4 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.0.3 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.0.2 app/controllers/devise/oauth2_providable/tokens_controller.rb
devise_oauth2_providable-1.0.1 app/controllers/devise/oauth2_providable/tokens_controller.rb