Class: Devise::Oauth2::TokensController

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

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
# File 'app/controllers/devise/oauth2/tokens_controller.rb', line 8

def create
  @refresh_token = oauth2_current_refresh_token || oauth2_current_client.refresh_tokens.create!(:owner => current_anything)
  @access_token = @refresh_token.access_tokens.create!(:client => oauth2_current_client, :owner => current_anything)
  render :json => @access_token.token_response
end