mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-10-01 22:58:05 -05:00
Added nexUser to express.Request type
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import crypto from 'node:crypto';
|
||||
import { HydratedDocument } from 'mongoose';
|
||||
import { Device } from '@models/device';
|
||||
import { NEXAccount } from '@models/nex-account';
|
||||
import util from '@util';
|
||||
@@ -161,7 +162,7 @@ export async function NASCMiddleware(request, response, next) {
|
||||
}
|
||||
}
|
||||
|
||||
const nexUser = await NEXAccount.findOne({ pid });
|
||||
const nexUser = await NEXAccount.findOne({ pid }) as HydratedDocument<INEXAccount, INEXAccountMethods>;
|
||||
|
||||
if (!nexUser || nexUser.get('access_level') < 0) {
|
||||
return response.status(200).send(util.nascError('102'));
|
||||
|
||||
1
types/express.d.ts
vendored
1
types/express.d.ts
vendored
@@ -5,6 +5,7 @@ declare global {
|
||||
namespace Express {
|
||||
interface Request {
|
||||
pnid?: HydratedDocument<IPNID, IPNIDMethods>;
|
||||
nexUser?: HydratedDocument<INEXAccount, INEXAccountMethods>;
|
||||
isCemu?: boolean;
|
||||
files?: Record<string, any>;
|
||||
certificate?: NintendoCertificate;
|
||||
|
||||
Reference in New Issue
Block a user