Skip to content

fix(auth): relax password complexity requirements to suggestions-only#5764

Open
ajnart wants to merge 6 commits into
devfrom
fix/credentials-login-session
Open

fix(auth): relax password complexity requirements to suggestions-only#5764
ajnart wants to merge 6 commits into
devfrom
fix/credentials-login-session

Conversation

@ajnart
Copy link
Copy Markdown
Member

@ajnart ajnart commented May 21, 2026

Summary

Relaxes password complexity validation to suggestions-only while keeping the minimum 8-character requirement enforced.

Changes

  • userPasswordSchema now only enforces min(8).max(255) — no more rejection for missing uppercase, lowercase, number, or special chars
  • Password popover shows neutral indicators (gray dot) for unmet suggestions instead of red X
  • Added "Password suggestions" title to the popover
  • Created UserCreatePasswordFields shared component used in onboarding and user management
  • Updated translation labels to reflect "suggested" wording
  • Controlled/uncontrolled input fix for CustomPasswordInput

Test plan

  • Unit test for passwords without complexity (8+ chars) pass validation
  • LoveHomarr<3 hashes correctly with bcrypt
  • E2E onboarding with special character password succeeds

Comment thread packages/auth/test/adapter.spec.ts Fixed
@ajnart ajnart force-pushed the fix/credentials-login-session branch 2 times, most recently from 42dd814 to e6ef990 Compare May 21, 2026 14:29
…lax password rules

Session creation failed with NOT NULL constraint on expires column due to
invalid date propagation from duration parsing. Override adapter.createSession
with validated insert, harden signIn callback, fix createDurationSchema for
numeric-only values, and guard events.ts group insert.

Also relaxes password complexity to suggestions-only (min 8 chars enforced),
extracts shared UserCreatePasswordFields component, and fixes login form
passing extra fields to signIn.
@ajnart ajnart force-pushed the fix/credentials-login-session branch from e6ef990 to 2732532 Compare May 21, 2026 14:30
@ajnart ajnart marked this pull request as ready for review May 22, 2026 07:11
@ajnart ajnart requested a review from a team as a code owner May 22, 2026 07:11
@ajnart ajnart added the needs-demo This PR needs a demo deployment label May 22, 2026
@dokploy-homarr-labs
Copy link
Copy Markdown

dokploy-homarr-labs Bot commented May 22, 2026

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
homarr ✅ Done Preview URL 2026-05-29T09:26:14.537Z

manuel-rw
manuel-rw previously approved these changes May 23, 2026
Copy link
Copy Markdown
Member

@manuel-rw manuel-rw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looks good to me, but @Meierschlumpf should review your redis changes

@Meierschlumpf
Copy link
Copy Markdown
Member

I never had such an issue, can you explain the way to reproduce the sqlite issue?
Also can we consider not putting things into this PR that are unrelated to password / auth? Like the changes in Dockerfile, regarding redis and the many null checks that seem unnecessary to me

Copy link
Copy Markdown
Member

@Meierschlumpf Meierschlumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment

@ajnart
Copy link
Copy Markdown
Member Author

ajnart commented May 25, 2026

@Meierschlumpf I honestly couldn't reproduce it again either, and AUTH_SESSION_EXPIRY_TIME fell-back to the default "30d". The createDurationSchema issue covers the case where someone passes a bare number (e.g. "86400"), but that wasn't the trigger here, I had this issue consistently at the time of the PR but I am not able to reproduce it anymore on the :latest image.. 🤷🏻‍♂️

At that time, I was doing a git stash and applying it to get the app working locally

We can disregard the changes to this if it's not relevant, but it might save someone that has a weird issue like mine. Perhaps it's a strange macos issue/a package update fixed it.

We can only keep the password-related changes if you think that's better

@Meierschlumpf
Copy link
Copy Markdown
Member

Okay understand, thanks
Yeah I would suggest that we only change the password requirements stuff then, if the other issue happens again we can look into it again, but I think it might have been just a local development issue due to either a package / migrations in the db that caused it

@ajnart ajnart changed the title fix(auth): resolve credentials login SQLITE_CONSTRAINT_NOTNULL and relax password rules fix(auth): relax password complexity requirements to suggestions-only May 25, 2026
Comment thread packages/auth/test/security.spec.ts Outdated
Comment thread packages/translation/src/lang/en.json Outdated
Comment thread e2e/onboarding.spec.ts Outdated
Comment thread packages/ui/src/components/password-input/password-input.tsx Outdated
Comment thread packages/ui/src/components/password-input/password-input.tsx Outdated
Comment thread packages/ui/src/components/password-input/password-requirement.tsx Outdated
ajnart added 2 commits May 29, 2026 11:16
Remove redundant tests, rename requirement translations to suggestion for clearer i18n, simplify password input state and requirement display.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-demo This PR needs a demo deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants