prashantGyeser / letsdine

This is the main repository for the letsdine source code base. The community module of letsdine will be stored in a separate repo.
0 stars 0 forks source link

Facebook sign up failing for some people #44

Open prashantGyeser opened 11 years ago

prashantGyeser commented 11 years ago

When trying to sign up with Facebook some users are facing an issue where they are not able to sign up.

The issue is one where Facebook is not returning a valid email address. Email is a required field in Devise, so the save to database fails because the email address field is NULL.

Below is the actual error. I have replaced the name of the person that tried to sign up with

OmniauthCallbacksController#facebook ActiveRecord::StatementInvalid

PG::Error: ERROR: null value in column "email" violates not-null constraint DETAIL: Failing row contains (1100, null, , null, null, null, 0, null, null, null, null, 2013-09-20 04:59:44.258203, 2013-09-20 04:59:44.258203, , facebook, 1835625458, CAADQo0gPKRIBAFmRlEl72BTZC0x7NfrONSoi0AcChVAn51SFKfQhZCxzUPtP1P6. .. , 2013-11-19 04:59:41.000000, http://graph.facebook. com/1835625458/ picture?type=square, null, null). : INSERT INTO "users" ("city", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "image", "last_sign_in_at", "last_sign_in_ip", "name", "oauth_expires_at", "oauth_token", "provider", "remember_created_at", "reset_password_sent_at", "reset_password_token", "role", "sign_in_count", "uid", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20) RETURNING "id"

prashantGyeser commented 11 years ago

Based on my research it looks like this happens because of one of two reasons

1) The user signs into FB with a phone number 2) User does not have a verified email address.