FIX: Return authenticated=true when reconnecting
This prevents a registration popup on the client
This commit is contained in:
parent
71d8807fec
commit
0f734e2ae2
|
@ -32,6 +32,7 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||
cookies.delete('fsl')
|
||||
return redirect_to Discourse.base_uri("/my/preferences/account")
|
||||
else
|
||||
@auth_result.authenticated = true
|
||||
return respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @auth_result.to_client_hash }
|
||||
|
|
|
@ -412,6 +412,7 @@ RSpec.describe Users::OmniauthCallbacksController do
|
|||
OmniAuth.config.mock_auth[:google_oauth2].uid = "123456"
|
||||
get "/auth/google_oauth2/callback.json"
|
||||
expect(response.status).to eq(200)
|
||||
expect(JSON.parse(response.body)["authenticated"]).to eq(true)
|
||||
expect(session[:current_user_id]).to eq(user.id)
|
||||
expect(GoogleUserInfo.count).to eq(1)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue