mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
assert uid for each request
This commit is contained in:
parent
5674402bb1
commit
6f41539587
@ -86,10 +86,10 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
|
||||
[RPC_CALL_ENVIRONMENT]: { req, res }
|
||||
});
|
||||
|
||||
const uid = await authDto.solveUID();
|
||||
if (!uid && !ctx.ip) {
|
||||
throw new OperationNotAllowedError(`Missing IP information for anonymous user`);
|
||||
}
|
||||
const uid = await authDto.assertUID();
|
||||
// if (!uid && !ctx.ip) {
|
||||
// throw new OperationNotAllowedError(`Missing IP information for anonymous user`);
|
||||
// }
|
||||
let rateLimitPolicy
|
||||
if (uid) {
|
||||
const user = await authDto.assertUser();
|
||||
@ -110,7 +110,7 @@ export const jinaAiMiddleware = (req: Request, res: Response, next: NextFunction
|
||||
} else {
|
||||
rateLimitPolicy = [
|
||||
RateLimitDesc.from({
|
||||
occurrence: 1,
|
||||
occurrence: 0,
|
||||
periodSeconds: 120
|
||||
})
|
||||
]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user