feat(backend): add getTracker method for IP extraction (#3535)

Co-authored-by: Raphael Hehl <Raphael.Hehl@deutschebahn.com>
This commit is contained in:
Raphael Hehl 2025-04-29 10:59:01 +02:00 committed by GitHub
parent 12f35d880d
commit cb52a582ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,4 +9,7 @@ export class GqlThrottlerGuard extends ThrottlerGuard {
const ctx = gqlCtx.getContext();
return { req: ctx.req, res: ctx.res };
}
protected async getTracker(req: Record<string, any>): Promise<string> {
return req.ips.length ? req.ips[0] : req.ip; // individualize IP extraction to meet your own needs
}
}