feat: add reddichat to default favorites
This commit is contained in:
parent
4be2f0f4b2
commit
76ae6fdb1b
|
@ -32,6 +32,9 @@ passport.use(new RedditStrategy(
|
||||||
const where = {redditUsername: profile.name};
|
const where = {redditUsername: profile.name};
|
||||||
const user = await User.findOne({where}) || await User.create(where);
|
const user = await User.findOne({where}) || await User.create(where);
|
||||||
user.redditAccessToken = accessToken;
|
user.redditAccessToken = accessToken;
|
||||||
|
if (user.isNewRecord) {
|
||||||
|
await user.createFavorite({channel: '/r/reddichat'});
|
||||||
|
}
|
||||||
await user.save();
|
await user.save();
|
||||||
done(undefined, user);
|
done(undefined, user);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user