@@ -13,7 +13,7 @@ import {
13
13
IAdminForthAndOrFilter ,
14
14
} from "../types/Back.js" ;
15
15
16
- import { ADMINFORTH_VERSION , listify , md5hash } from './utils.js' ;
16
+ import { ADMINFORTH_VERSION , listify , md5hash , getLoginPromptHTML } from './utils.js' ;
17
17
18
18
import AdminForthAuth from "../auth.js" ;
19
19
import { ActionCheckSource , AdminForthConfigMenuItem , AdminForthDataTypes , AdminForthFilterOperators , AdminForthResourceCommon , AdminForthResourcePages ,
@@ -210,7 +210,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
210
210
const resource = this . adminforth . config . resources . find ( ( res ) => res . resourceId === this . adminforth . config . auth . usersResourceId ) ;
211
211
const usernameColumn = resource . columns . find ( ( col ) => col . name === usernameField ) ;
212
212
213
- let loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
213
+ const loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
214
214
215
215
return {
216
216
brandName : this . adminforth . config . customization . brandName ,
@@ -229,17 +229,6 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
229
229
} ,
230
230
} ) ;
231
231
232
- async function getLoginPromptHTML ( prompt ) {
233
- if ( typeof prompt === 'function' ) {
234
- const result = await prompt ( ) ;
235
- if ( result !== undefined ) {
236
- return result ;
237
- }
238
- return "" ;
239
- } else {
240
- return prompt ;
241
- }
242
- }
243
232
server . endpoint ( {
244
233
method : 'GET' ,
245
234
path : '/get_base_config' ,
@@ -303,7 +292,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
303
292
304
293
const announcementBadge : AnnouncementBadgeResponse = this . adminforth . config . customization . announcementBadge ?.( adminUser ) ;
305
294
306
- let loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
295
+ const loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
307
296
308
297
309
298
const publicPart = {
0 commit comments