Class: Opro::Oauth::AuthController
- Inherits:
-
OproController
- Object
- ApplicationController
- OproController
- Opro::Oauth::AuthController
- Defined in:
- app/controllers/opro/oauth/auth_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
:ask_user! is called before creating a new authorization, this allows us to redirect.
- #new ⇒ Object
Instance Method Details
#create ⇒ Object
:ask_user! is called before creating a new authorization, this allows us to redirect
12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/opro/oauth/auth_controller.rb', line 12 def create # find or create an auth_grant for a given user application = Opro::Oauth::ClientApp.find_by_client_id(params[:client_id]) auth_grant = Opro::Oauth::AuthGrant.find_or_create_by_user_app(current_user, application) # add permission changes if there are any auth_grant.(params[:permissions]) redirect_to auth_grant.redirect_uri_for(params[:redirect_uri], params[:state]) end |