Closed haziqfiqri closed 5 years ago
Lmao what was I thinking, here is the updated code
request(profileURL, function(err, response, body){
var data = JSON.parse(body);
var profile = data.response.players[0];
var user = {
username: profile.personaname,
profileURL: profile.profileurl,
profileImageURL: profile.avatarfull,
steamId: profile.steamid
}
User.findOneAndUpdate({ steamId: steamId }, user, {upsert: true, new: true, setDefaultsOnInsert: true}, function(err, newUser){
if (err) handleError(err);
done(null, newUser);
});
});
Have you sorted your issue, @haziqfiqri ?
Yes i have :)
On Sat, 19 Oct 2019, 12:14 am Steven Agyekum, notifications@github.com wrote:
Have you sorted your issue, @haziqfiqri https://github.com/haziqfiqri ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/liamcurry/passport-steam/issues/94?email_source=notifications&email_token=AG7ZYZOLXEX7R7XWLPPI7C3QPHOFHA5CNFSM4JB4OZNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBU7PSA#issuecomment-543815624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG7ZYZJ3RSQM4AMSJCVWS23QPHOFHANCNFSM4JB4OZNA .y
I'm having issues with when an existence user trying to login back and update the database, non existence user login works alright as it will create one inside db, tried @Burnett01 solution here but doesnt work tho, still get the error. How can I solve this, Can someone kindly help?
/routes/auth.js
app.js