mirror of
https://github.com/whyour/qinglong.git
synced 2026-03-13 15:05:10 +08:00
Fix /open/user/init auth bypass allowing credential reset on initialized systems (#2941)
* Initial plan * fix: add /open/user/init paths to init guard to prevent auth bypass Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> Co-authored-by: whyour <imwhyour@gmail.com>
This commit is contained in:
parent
ce599d306f
commit
6bec52dca1
|
|
@ -120,7 +120,14 @@ export default ({ app }: { app: Application }) => {
|
||||||
|
|
||||||
app.use(async (req, res, next) => {
|
app.use(async (req, res, next) => {
|
||||||
const pathLower = req.path.toLowerCase();
|
const pathLower = req.path.toLowerCase();
|
||||||
if (!['/api/user/init', '/api/user/notification/init'].includes(pathLower)) {
|
if (
|
||||||
|
![
|
||||||
|
'/api/user/init',
|
||||||
|
'/api/user/notification/init',
|
||||||
|
'/open/user/init',
|
||||||
|
'/open/user/notification/init',
|
||||||
|
].includes(req.path)
|
||||||
|
) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
const authInfo =
|
const authInfo =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user