ruby on rails - Facebook UID from response doesn't match with user's uid stored in database -


i have problem on production facebook login happened today. i'm using rails omniouth-facebook gem authentication users via fb.

so, after debugging figure out uid got in response facebook isn't same uid particular user has stored in database.

i have part:

find_by(provider: auth.provider, uid: auth.uid) 

where auth env['omniauth.auth'] , when manually check user auth.email in database uids not matched, function returns nil , login failure.

does has idea problem? appreciate hint.

thanks, bojan

with api v2.0, facebook introduced app-scoped user ids.

for every new user logs in app after switch made 2.0, not “global” user id more, app-scoped one, unique app - more specific, tied app id.

so if using different app ids, resp. switched app ids @ point, of course different app-scoped ids same user.

if have business has several apps, can connect them via business manager, can connect different app-scoped user ids different apps.