dan-divy/spruce

Multiple sign ins

dan-online opened this issue · 8 comments

Signing in with google or instagram makes a new account every time

Hey dude,
You should see utils/handlers/user.js
And see the difference between findOne() and checkUser().
I noticed that you change findOne() to checkUser() in your commits.

The correct one to use is findOne() in case of oauth sign-in.
Check the website to see if there are multiple signins or not and then you'll check the difference.

So should I do db.findOne({id: user.sub}, cb) as this is still making double accounts

Actually you should find by id but as
username

db.findOne{{username:user.username});
Works for me..

Just checkout the code on Github.
Under routes/auth.js

yes but google doesn't supply a username so it can't find it.

Ya ,
For now we use user.name until we create something for the username.

Should work fine now.

Should I close the issue?

Ye sure, add it to the pull request first though