Class: Devise::Oauth2Providable::TokensController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/devise/oauth2_providable/tokens_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
# File 'app/controllers/devise/oauth2_providable/tokens_controller.rb', line 6

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