Skip to content

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

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

yaroslav8765
Copy link

No description provided.

@yaroslav8765 yaroslav8765 requested a review from ivictbor July 23, 2025 13:57
@@ -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 }) => {
Copy link
Collaborator

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?

@yaroslav8765 yaroslav8765 requested a review from SerVitasik July 28, 2025 10:31
@@ -290,6 +297,14 @@ export default class AdminForthRestAPI implements IAdminForthRestAPI {
}

const announcementBadge: AnnouncementBadgeResponse = this.adminforth.config.customization.announcementBadge?.(adminUser);

let loginPromptHTML;
Copy link
Collaborator

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 "";
Copy link
Contributor

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!

@yaroslav8765 yaroslav8765 requested a review from ivictbor July 30, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants