mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
fix(3p): bad import, change flag format
This commit is contained in:
@@ -10,6 +10,7 @@ import gcpStackdriverTracer from '../libs/gcpTraceAgent';
|
||||
import common from '../../common';
|
||||
import { getLanguageFromUser } from '../libs/language';
|
||||
|
||||
const OFFICIAL_PLATFORMS = ['habitica-web', 'habitica-ios', 'habitica-android'];
|
||||
const COMMUNITY_MANAGER_EMAIL = nconf.get('EMAILS_COMMUNITY_MANAGER_EMAIL');
|
||||
const USER_FIELDS_ALWAYS_LOADED = ['_id', 'notifications', 'preferences', 'auth', 'flags', 'permissions'];
|
||||
|
||||
@@ -91,8 +92,8 @@ export function authWithHeaders (options = {}) {
|
||||
req.session.userId = user._id;
|
||||
stackdriverTraceUserId(user._id);
|
||||
user.auth.timestamps.updated = new Date();
|
||||
if (common.constants.OFFICIAL_PLATFORMS.indexOf(client) === -1 && !user.flags.thirdPartyTools) {
|
||||
User.updateOne(userQuery, { $set: { 'flags.thirdPartyTools': true }}).exec();
|
||||
if (OFFICIAL_PLATFORMS.indexOf(client) === -1 && !user.flags.thirdPartyTools) {
|
||||
User.updateOne(userQuery, { $set: { 'flags.thirdPartyTools': new Date() } }).exec();
|
||||
}
|
||||
return next();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user