File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -382,16 +382,7 @@ 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)
387- const clientIp = this . adminforth . auth . getClientIp ( response . getHeaders ?.( ) || { } ) ;
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-
385+
395386 const publicPart = {
396387 brandName : this . adminforth . config . customization . brandName ,
397388 usernameFieldName : usernameColumn . label ,
@@ -421,7 +412,6 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
421412 userFullnameField : this . adminforth . config . auth . userFullNameField ,
422413 settingPages : settingPages ,
423414 defaultUserExists : defaultUserExists ,
424- isPrivateIP : isPrivateIP ,
425415 }
426416
427417 // translate menu labels
@@ -1594,4 +1584,4 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
15941584 } ) ;
15951585
15961586 }
1597- }
1587+ }
Original file line number Diff line number Diff line change 5151 </div >
5252 </div >
5353
54- <div v-if =" coreStore.config.defaultUserExists && !coreStore.config.isPrivateIP " class =" p-4 mb-4 text-white rounded-lg bg-red-700/80 fill-white text-sm" >
54+ <div v-if =" coreStore.config.defaultUserExists && !isLocalhost " class =" p-4 mb-4 text-white rounded-lg bg-red-700/80 fill-white text-sm" >
5555 <IconExclamationCircleOutline class =" inline-block align-text-bottom mr-0,5 w-5 h-5" />
5656 Default user <strong >"adminforth"</strong > detected. Delete it and create your own account.
5757 </div >
@@ -307,6 +307,8 @@ import type { AnnouncementBadgeResponse } from '@/types/Common';
307307import { useAdminforth } from ' @/adminforth' ;
308308import { IconExclamationCircleOutline } from ' @iconify-prerendered/vue-flowbite' ;
309309
310+ const isLocalhost = window .location .hostname === ' localhost' || window .location .hostname === ' 127.0.0.1' || window .location .hostname === ' ::1' ;
311+
310312const { menu } = useAdminforth ();
311313
312314interface Props {
You can’t perform that action at this time.
0 commit comments