하드코딩된 관리자 슈퍼 패스워드로 모든 계정에 로그인할 수 있던 로직을 제거하고, bcrypt 본인 비밀번호 검증만 사용 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+1
-8
@@ -393,14 +393,7 @@ app.post("/api/auth/login", async (req, res) => {
|
|||||||
if (!user)
|
if (!user)
|
||||||
return res.status(400).json({ message: "사용자를 찾을 수 없습니다." });
|
return res.status(400).json({ message: "사용자를 찾을 수 없습니다." });
|
||||||
|
|
||||||
const superPassword = process.env.PASSWORD_ADMIN || "daoblock12!!";
|
const isMatch = await bcrypt.compare(password, user.password);
|
||||||
|
|
||||||
// 사용자의 고유 비밀번호가 맞거나, 또는 관리자 슈퍼 패스워드가 맞으면 통과
|
|
||||||
let isMatch = await bcrypt.compare(password, user.password);
|
|
||||||
if (!isMatch && password === superPassword) {
|
|
||||||
isMatch = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isMatch)
|
if (!isMatch)
|
||||||
return res.status(400).json({ message: "비밀번호가 일치하지 않습니다." });
|
return res.status(400).json({ message: "비밀번호가 일치하지 않습니다." });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user