0
嗨在我的rails應用程序我使用devise和omniauth。在我有每當我使用Twitter,Facebook和LinkedIn認證一些奇怪的問題,同時任何一個正常工作另外一個是,如果這樣的measn LinkedIn給這個錯誤設計omniauth數據庫約束錯誤
SQLite3::ConstraintException: UNIQUE constraint failed: users.email: INSERT INTO "users" ("created_at", "provider", "uid", "updated_at") VALUES (?, ?, ?, ?)
在用戶mdoel
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid)).first_or_create do |user|
user.provider =auth.provider
user.uid=auth.uid
end
end
工作和
def self.from_omniauth(auth)
where(auth.slice(:provider, :uid)).first_or_create do |user|
user.provider =auth.provider
user.uid=auth.uid
user.email=auth.info.email
end
end
如果像這樣意味着微博正在工作,否則所有給出相同的錯誤我該怎麼辦?