@@ -194,6 +194,18 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
194194 } ,
195195 } )
196196
197+ server . endpoint ( {
198+ noAuth : true ,
199+ method : 'GET' ,
200+ path : '/get_login_form_config' ,
201+ handler : async ( { tr } ) => {
202+ const loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
203+ return {
204+ loginPromptHTML : await tr ( loginPromptHTML , 'system.loginPromptHTML' ) ,
205+ }
206+ }
207+ } )
208+
197209 server . endpoint ( {
198210 noAuth : true ,
199211 method : 'GET' ,
@@ -210,16 +222,13 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
210222 const resource = this . adminforth . config . resources . find ( ( res ) => res . resourceId === this . adminforth . config . auth . usersResourceId ) ;
211223 const usernameColumn = resource . columns . find ( ( col ) => col . name === usernameField ) ;
212224
213- const loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
214-
215225 return {
216226 brandName : this . adminforth . config . customization . brandName ,
217227 usernameFieldName : usernameColumn . label ,
218228 loginBackgroundImage : this . adminforth . config . auth . loginBackgroundImage ,
219229 loginBackgroundPosition : this . adminforth . config . auth . loginBackgroundPosition ,
220230 title : this . adminforth . config . customization ?. title ,
221231 demoCredentials : this . adminforth . config . auth . demoCredentials ,
222- loginPromptHTML : await tr ( loginPromptHTML , 'system.loginPromptHTML' ) ,
223232 loginPageInjections : this . adminforth . config . customization . loginPageInjections ,
224233 globalInjections : {
225234 everyPageBottom : this . adminforth . config . customization . globalInjections . everyPageBottom ,
@@ -292,7 +301,6 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
292301
293302 const announcementBadge : AnnouncementBadgeResponse = this . adminforth . config . customization . announcementBadge ?.( adminUser ) ;
294303
295- const loginPromptHTML = await getLoginPromptHTML ( this . adminforth . config . auth . loginPromptHTML ) ;
296304
297305
298306 const publicPart = {
@@ -302,7 +310,6 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
302310 loginBackgroundPosition : this . adminforth . config . auth . loginBackgroundPosition ,
303311 title : this . adminforth . config . customization ?. title ,
304312 demoCredentials : this . adminforth . config . auth . demoCredentials ,
305- loginPromptHTML : await tr ( loginPromptHTML , 'system.loginPromptHTML' ) ,
306313 loginPageInjections : this . adminforth . config . customization . loginPageInjections ,
307314 rememberMeDays : this . adminforth . config . auth . rememberMeDays ,
308315 }
0 commit comments