mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-12-03 05:10:04 +01:00
Fix saving last user agent and browser id
This commit is contained in:
1 parent
3e7c673edd
commit
cc5232030f
1 file changed
+3
-1
@@ -4,6 +4,7 @@ import { offline, hash, handleJSON } from '../requestUtils';
|
||||
import { createGetAccountData } from '../api/account';
|
||||
import { Settings, ServerConfig } from '../../common/adminInterfaces';
|
||||
import { includes } from '../../common/utils';
|
||||
import { logger } from '../logger';
|
||||
|
||||
const blockApps: string[] = [];
|
||||
const MAX_CONCURRENT_REQUESTS = 100;
|
||||
@@ -26,7 +27,8 @@ export default function (server: ServerConfig, settings: Settings) {
|
||||
(lastBrowserId && account.lastBrowserId !== lastBrowserId)) {
|
||||
account.lastUserAgent = lastUserAgent;
|
||||
account.lastBrowserId = lastBrowserId;
|
||||
Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId });
|
||||
Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId }).exec()
|
||||
.catch(e => logger.error(e));
|
||||
}
|
||||
|
||||
return await getAccountData(account);
|
||||
|
||||
Reference in new issue
Block a user