-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add possibility to pass function into the loginPromptHTML #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
adminforth/modules/restApi.ts
Outdated
@@ -198,7 +198,7 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI { | |||
noAuth: true, | |||
method: 'GET', | |||
path: '/get_public_config', | |||
handler: async ({ tr }) => { | |||
handler: async ({ tr, adminUser }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't use this arg, why did you add it?
adminforth/modules/restApi.ts
Outdated
@@ -290,6 +297,14 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI { | |||
} | |||
|
|||
const announcementBadge: AnnouncementBadgeResponse = this.adminforth.config.customization.announcementBadge?.(adminUser); | |||
|
|||
let loginPromptHTML; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't repeat yourself
if (adminforthUserExists) { | ||
return "Please use <b>adminforth</b> as username and <b>adminforth</b> as password" | ||
} | ||
return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaroslav8765 can we remove this return? I think function shoudl understand undefined as well!
No description provided.