feat: option to disable password login [closes #478]#479
feat: option to disable password login [closes #478]#479zxh326 merged 4 commits intokite-org:mainfrom
Conversation
Add a "Password Login" toggle to the Authentication settings page. When disabled, the password login form is hidden from the login page and the /api/auth/login/password endpoint returns 403. An amber warning alerts admins about potential lockout before saving. Add a "Skip login page" toggle to OAuth Provider Management, visible when password login is disabled and exactly one OAuth provider is configured. When enabled, users are redirected straight to the OAuth provider instead of seeing the login page. Closes kite-org#478
|
This project is way better than headlamp. Ran locally and tested with Pocket ID (OAuth Provider). Works perfectly. |
zxh326
left a comment
There was a problem hiding this comment.
Thanks for the contribution
We do not want to introduce a skip login page feature here.
Please remove the skipLoginPage backend/frontend changes from this PR and keep it focused on disable password login only.
|
@zxh326 Done in 9c878e0 — The rebuild has been deployed and verified to be working perfectly. Login page skip (it's actually a redirect) is standard functionality in many similar applications, but I can understand the concern given it opens doors to redirect loops, etc. I've removed this now. If you ever want to implement this, you have the code in 7121ca3 to work off of. Proposed docs addition for
|
Signed-off-by: Zzde <zhangxh1997@gmail.com>
Summary
/api/auth/login/passwordwhen disabledGeneralSettingand survive restartsChanges
Backend:
pkg/model/general_setting.go— addPasswordLoginDisabledandSkipLoginPagefieldspkg/auth/login_handler.go— exclude password from providers when disabled, return 403 on password login, exposeskipLoginPagein providers responsepkg/ai/handler.go— include both fields in general settings GET/PUTFrontend:
authentication-management.tsx— Password Login toggle with warning, tied to existing Save buttonoauth-provider-management.tsx— Skip login page toggle (instant save)auth-context.tsx— threadskipLoginPagethrough contextlogin.tsx— auto-redirect to OAuth when skip is enabledadmin.ts/auth.ts— type updatesTest plan
Closes #478