0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00

added controller to handle callbacks

Dieser Commit ist enthalten in:
Robert Barrow 2019-05-22 11:46:34 +01:00
Ursprung 52b8c229ba
Commit fdecbe155e
2 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen

12
controllers/authorization.rb Normale Datei
Datei anzeigen

@ -0,0 +1,12 @@
class CustomWizard::AuthorizationController < ::ApplicationController
skip_before_action :check_xhr,
:preload_json,
:redirect_to_login_if_required,
:verify_authenticity_token
def callback
# TODO: work out which service it relates to!
CustomWizard::Authorization.set_code(service, params[:code])
CustomWizard::Authorization.get_access_token(service)
end
end

Datei anzeigen

@ -49,6 +49,7 @@ after_initialize do
get ':wizard_id/steps' => 'wizard#index' get ':wizard_id/steps' => 'wizard#index'
get ':wizard_id/steps/:step_id' => 'wizard#index' get ':wizard_id/steps/:step_id' => 'wizard#index'
put ':wizard_id/steps/:step_id' => 'steps#update' put ':wizard_id/steps/:step_id' => 'steps#update'
get 'authorization/callback' => "authorization#callback"
end end
require_dependency 'admin_constraint' require_dependency 'admin_constraint'
@ -81,6 +82,7 @@ after_initialize do
load File.expand_path('../controllers/wizard.rb', __FILE__) load File.expand_path('../controllers/wizard.rb', __FILE__)
load File.expand_path('../controllers/steps.rb', __FILE__) load File.expand_path('../controllers/steps.rb', __FILE__)
load File.expand_path('../controllers/admin.rb', __FILE__) load File.expand_path('../controllers/admin.rb', __FILE__)
load File.expand_path('../controllers/authorization.rb', __FILE__)
::UsersController.class_eval do ::UsersController.class_eval do
def wizard_path def wizard_path