-
Notifications
You must be signed in to change notification settings - Fork 23
feat: customize 401 Unauthorized page with login prompt #248
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: master
Are you sure you want to change the base?
feat: customize 401 Unauthorized page with login prompt #248
Conversation
📝 WalkthroughWalkthroughThis change adds special handling for 401 Unauthorized errors in the error notification component. The controller now exposes the error code as a binding, and the template conditionally renders a custom login prompt for 401 errors while displaying generic error messages for all other codes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
hello @JJ-Author ! Hi, I’ve implemented a customized 401 Unauthorized page for private setups. This replaces the default browser 401 message with a friendly login prompt. Please review and let me know if any changes are needed. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
public/js/components/error-notification/error-notification.html (1)
1-11: 401‑specific template matches requirements; consider keeping text configurable/i18n‑friendlyThis template cleanly introduces a 401‑only branch with a clear login prompt and a
/loginlink, and falls back to the existingget($ctrl.key)messaging for all other codes, which aligns well with the PR’s goal.One thing to watch: for 401 you now bypass
DatabusMsg.get(...)and hardcode English strings. If Databus previously supported localization or if you want “customizable” text without editing templates, consider routing these through your message/config system as well (e.g., dedicated keys for the 401 title, body, and link label).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
public/js/components/error-notification/error-notifcation.js(1 hunks)public/js/components/error-notification/error-notification.html(1 hunks)
This PR customizes the initial 401 Unauthorized page in private setups by adding a friendly login prompt.
Fixes #149
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.