We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 366044b commit 1a1da91Copy full SHA for 1a1da91
1 file changed
adminforth/modules/restApi.ts
@@ -382,8 +382,15 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
382
if (username === 'adminforth') {
383
defaultUserExists = true;
384
}
385
+
386
+ // getting client ip address (if null - ip definetely is private, if not null - check if it is private)
387
const clientIp = this.adminforth.auth.getClientIp(response.getHeaders?.() || {});
- const isPrivateIP = is_ip_private(clientIp) === undefined || false ? true : false;
388
+ let isPrivateIP = true;
389
390
+ if (clientIp) {
391
+ // ip is not null, so we need to make sure that it is not private
392
+ isPrivateIP = is_ip_private(clientIp);
393
+ }
394
395
const publicPart = {
396
brandName: this.adminforth.config.customization.brandName,
0 commit comments