From: Ilya Zverev Date: Mon, 30 Nov 2015 07:42:07 +0000 (-0500) Subject: Facebook emails are verified X-Git-Tag: live~4015 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/988ee11fe4165d8856f5d8a105bf95777168a8b0 Facebook emails are verified Per https://developers.facebook.com/docs/graph-api/reference/user the offical description of the email field is: > The person's primary email address listed on their profile. This > field will not be returned if no valid email address is available Therefore we can treat the fact that the email is returned as proof that it has been verified. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index fca0e3be7..6390ff19e 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -497,7 +497,7 @@ class UserController < ApplicationController when "openid" email_verified = uid.match(%r{https://www.google.com/accounts/o8/id?(.*)}) || uid.match(%r{https://me.yahoo.com/(.*)}) - when "google" + when "google", "facebook" email_verified = true else email_verified = false