Commit Graph
16 Commits
Author SHA1 Message Date
HimeHina df0e1256e6 Fix: HTTP Basic Auth fails when password contains colons (#5153)
* Fix: HTTP Basic Auth fails when password contains colons

The credentials in HTTP Basic Auth are formatted as base64(username:password).
Per RFC 7617, the username must not contain a colon, but the password can.
The previous code used `.split(':')` which splits on all colons, truncating
passwords that contain ':' characters. Fix by splitting only on the first colon.

* Use spread syntax for credential parsing
2026-02-14 17:44:54 +02:00
Cohee 00bb36f764 Fix setting basic auth creds with env 2025-02-20 22:38:47 +02:00
Cohee 3f03936125 Add config value type converters for numbers and booleans 2025-02-20 21:53:48 +02:00
Cohee 9aac5a22f1 Defer middleware HTML file reads 2025-01-26 01:46:30 +02:00
Spappz 6099ffece1 No exceptions on missing error webpages
- Create a `safeReadFileSync()` function in `src/utils.js` to wrap around `fs.readFileSync()`
- Migrate error-webpage loads to use `safeReadFileSync()`, with default values of an empty string
- Move the 404 error middleware to explicitly only be called *after* extensions are registered
2025-01-25 20:29:31 +00:00
Spappz 538d66191e add 401 error page for basicAuth mode
Most modern browsers don't actually show users 401 responses, but it doesn't hurt to have it in there anyway ¯\_(ツ)_/¯
2025-01-25 03:40:47 +00:00
Cohee 1616e7e067 Explicitly import Buffer. Specify jsdoc local extensions 2024-10-10 23:36:22 +03:00
Cohee d52b4fbbde Node: Migrate to ES Modules 2024-10-10 22:37:22 +03:00
QuantumEntangledAndy 06a7bdd3ce Only allow login via basic per-user if user password is set 2024-10-09 15:04:28 +07:00
Cohee fe1f9fafbd [bug] Don't allow per user auth with accounts disabled 2024-10-09 10:43:52 +03:00
Cohee 0ada5407ee [bug] Fix login attempts to disabled users 2024-10-09 01:54:56 +03:00
Cohee 8a95e0a290 [chore] Reformat 2024-10-09 01:38:32 +03:00
Cohee b9375ed7ea Rename PERUSER => PER_USER 2024-10-09 01:37:34 +03:00
QuantumEntangledAndy 71236e5e8c eslint 2024-10-06 15:06:05 +07:00
QuantumEntangledAndy 69a604044d Add additional login methods 2024-10-06 14:35:03 +07:00
Cohee dd7ac914a6 Rename basic auth middleware 2023-12-15 18:43:00 +02:00