feat: add reddichat to default favorites

This commit is contained in:
cha0s 2020-07-25 08:54:50 -05:00
parent 4be2f0f4b2
commit 76ae6fdb1b

View File

@ -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);
} }