File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -382,8 +382,15 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
382382 if ( username === 'adminforth' ) {
383383 defaultUserExists = true ;
384384 }
385+
386+ // getting client ip address (if null - ip definetely is private, if not null - check if it is private)
385387 const clientIp = this . adminforth . auth . getClientIp ( response . getHeaders ?.( ) || { } ) ;
386- 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+ }
387394
388395 const publicPart = {
389396 brandName : this . adminforth . config . customization . brandName ,
You can’t perform that action at this time.
0 commit comments