Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
added controller to handle callbacks
Dieser Commit ist enthalten in:
Ursprung
52b8c229ba
Commit
fdecbe155e
2 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen
12
controllers/authorization.rb
Normale Datei
12
controllers/authorization.rb
Normale Datei
|
@ -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
|
|
@ -49,6 +49,7 @@ after_initialize do
|
|||
get ':wizard_id/steps' => 'wizard#index'
|
||||
get ':wizard_id/steps/:step_id' => 'wizard#index'
|
||||
put ':wizard_id/steps/:step_id' => 'steps#update'
|
||||
get 'authorization/callback' => "authorization#callback"
|
||||
end
|
||||
|
||||
require_dependency 'admin_constraint'
|
||||
|
@ -81,6 +82,7 @@ after_initialize do
|
|||
load File.expand_path('../controllers/wizard.rb', __FILE__)
|
||||
load File.expand_path('../controllers/steps.rb', __FILE__)
|
||||
load File.expand_path('../controllers/admin.rb', __FILE__)
|
||||
load File.expand_path('../controllers/authorization.rb', __FILE__)
|
||||
|
||||
::UsersController.class_eval do
|
||||
def wizard_path
|
||||
|
|
Laden …
In neuem Issue referenzieren