Fix verified check when signing in with Google
The Google response contains an `email_verified` field instead of a `verified_email` field, and so we weren't treating verified Google accounts as verified.
This commit is contained in:
@@ -479,6 +479,31 @@ describe "Users" do
|
||||
end
|
||||
end
|
||||
|
||||
context "Google" do
|
||||
let(:google_hash) do
|
||||
{
|
||||
uid: "12345",
|
||||
info: {
|
||||
name: "manuela",
|
||||
email: "manuelacarmena@example.com",
|
||||
email_verified: "1"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
before { Setting["feature.google_login"] = true }
|
||||
|
||||
scenario "Sign in with an already registered user using a verified google account" do
|
||||
OmniAuth.config.add_mock(:google_oauth2, google_hash)
|
||||
create(:user, username: "manuela", email: "manuelacarmena@example.com")
|
||||
|
||||
visit new_user_session_path
|
||||
click_link "Sign in with Google"
|
||||
|
||||
expect_to_be_signed_in
|
||||
end
|
||||
end
|
||||
|
||||
context "Wordpress" do
|
||||
let(:wordpress_hash) do
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user