mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
backend: auth bug fix
This commit is contained in:
parent
d932fcb287
commit
c92f84c24f
7 changed files with 12 additions and 81 deletions
|
@ -65,9 +65,15 @@ module.exports = async (req, res) => {
|
|||
first_name, last_name, name, photo
|
||||
}).save();
|
||||
|
||||
res.render('social/success', { title: STRINGS.OAUTH.SUCCESS_TITLE, ...user });
|
||||
console.log('AUTH', auth.toObject());
|
||||
res.render('social/success', { title: STRINGS.OAUTH.SUCCESS_TITLE, ...user, token: auth.token });
|
||||
} else {
|
||||
const created = await User.create(user, (err, result) => result.toObject());
|
||||
const created = await User.create(user, (err, result) => {
|
||||
if (err) console.log('ERRRRRR', err);
|
||||
|
||||
console.log('USER', result);
|
||||
return result.toObject();
|
||||
});
|
||||
|
||||
res.render('social/success', { title: STRINGS.OAUTH.SUCCESS_TITLE, ...user, ...created });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue