fix(auth): resolve credentials login SQLITE_CONSTRAINT_NOTNULL and relax 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.
This commit is contained in:
Thomas Camlong committed 2026-05-21 16:30:07 +02:00
1 parent dade477b32
commit 27325326da
21 files changed
+274 -86

No files matched your search

+31
View File
@@ -42,6 +42,37 @@ describe("Onboarding", () => {
await homarrContainer.stop();
}, 60_000);
test("Credentials onboarding with special character password should be successful", async () => {
const { db, localMountPath } = await createSqliteDbFileAsync();
const homarrContainer = await createHomarrContainer({
mounts: {
"/appdata": localMountPath,
},
}).start();
const browser = await chromium.launch();
const context = await browser.newContext();
const page = await context.newPage();
const actions = new OnboardingActions(page, db);
const assertions = new OnboardingAssertions(page, db);
await page.goto(`http://${homarrContainer.getHost()}:${homarrContainer.getMappedPort(7575)}`);
await actions.startOnboardingAsync("scratch");
await actions.processUserStepAsync({
username: "admin",
password: "LoveHomarr<3",
confirmPassword: "LoveHomarr<3",
});
await actions.processSettingsStepAsync();
await assertions.assertFinishStepVisibleAsync();
await assertions.assertUserAndAdminGroupInsertedAsync("admin");
await assertions.assertDbOnboardingStepAsync("finish");
await browser.close();
await homarrContainer.stop();
}, 60_000);
test("External provider onboarding setup should be successful", async () => {
// Arrange
const { db, localMountPath } = await createSqliteDbFileAsync();