Class: Users::AssociateAccountsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Users::AssociateAccountsController
- Defined in:
- app/controllers/users/associate_accounts_controller.rb
Instance Method Summary collapse
Instance Method Details
#connect ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/users/associate_accounts_controller.rb', line 19 def connect if authenticator.description_for_user(current_user).present? && authenticator.can_revoke? authenticator.revoke(current_user) end DiscourseEvent.trigger(:before_auth, authenticator, auth_hash, session, , request) auth_result = authenticator.after_authenticate(auth_hash, existing_account: current_user) DiscourseEvent.trigger(:after_auth, authenticator, auth_result, session, , request) secure_session[self.class.key(params[:token])] = nil render json: success_json end |
#connect_info ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/users/associate_accounts_controller.rb', line 8 def connect_info account_description = authenticator.description_for_auth_hash(auth_hash) existing_account_description = authenticator.description_for_user(current_user).presence render json: { token: params[:token], provider_name: auth_hash.provider, account_description: account_description, existing_account_description: existing_account_description, } end |