DEV: Let OmniAuth strategies return auth result. (#7833)

This commit is contained in:
Dan Ungureanu
2019-07-01 19:13:11 +03:00
committed by Rafael dos Santos Silva
parent f56d86a852
commit dc5eb76551
2 changed files with 29 additions and 0 deletions

View File

@@ -19,6 +19,15 @@ class Users::OmniauthCallbacksController < ApplicationController
skip_before_action :verify_authenticity_token, only: :complete
def complete
if result = request.env["omniauth.result"]
@auth_result = result
return respond_to do |format|
format.html
format.json { render json: @auth_result.to_client_hash }
end
end
auth = request.env["omniauth.auth"]
raise Discourse::NotFound unless request.env["omniauth.auth"]