BARON-SSO 로그인 UI 수정
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 12s
ITAM Docker Build Check / docker-build-check (push) Successful in 24s

This commit is contained in:
2026-07-01 14:14:32 +09:00
parent 75b6ac4784
commit 6aae6d7dff
3 changed files with 27 additions and 8 deletions

8
.env
View File

@@ -3,8 +3,8 @@ DB_PORT=3306
DB_USER=itam DB_USER=itam
DB_PASS=itam1234 DB_PASS=itam1234
DB_NAME=itam DB_NAME=itam
CLIENT_ID=c89acfda-789b-45fb-bab6-7ebfa4c6a9b4 CLIENT_ID=ffb5f168-5dea-4d90-8faa-1fa7acc5089b
ISSUER=https://sso.hmac.kr/oidc ISSUER=https://app.brsw.kr/oidc
REDIRECT_URI=http://172.16.9.44:8080/callback REDIRECT_URI=https://dachs.hmac.kr/callback
JWKS_URI=http://172.16.9.44:8080/.well-known/jwks.json JWKS_URI=https://dachs.hmac.kr/.well-known/jwks.json
PORT=3000 PORT=3000

View File

@@ -17,7 +17,7 @@
<div class="login-layout" id="login-container" style="display: none;"> <div class="login-layout" id="login-container" style="display: none;">
<section class="login-card"> <section class="login-card">
<div class="login-header"> <div class="login-header">
<img src="/image 92.png" alt="Logo" class="login-logo" /> <img src="/img/image_92.png" alt="Logo" class="login-logo" />
<h2>한맥자산관리시스템</h2> <h2>한맥자산관리시스템</h2>
<p>전화번호로 본인 확인 후 로그인하세요.</p> <p>전화번호로 본인 확인 후 로그인하세요.</p>
</div> </div>
@@ -27,7 +27,7 @@
<span>전화번호</span> <span>전화번호</span>
<input id="phone-login-id" name="phoneLoginId" type="tel" autocomplete="tel" placeholder="휴대전화 번호 입력" required /> <input id="phone-login-id" name="phoneLoginId" type="tel" autocomplete="tel" placeholder="휴대전화 번호 입력" required />
</label> </label>
<p id="phone-login-hint" class="login-hint">숫자만 입력하면 됩니다. 인증 링크는 등록된 카카오톡 또는 SMS로 전송됩니다.</p> <p id="phone-login-hint" class="login-hint">숫자만 입력하면 됩니다. 인증 링크는 등록된 SMS로 전송됩니다.</p>
<p id="phone-login-status" class="login-status" hidden></p> <p id="phone-login-status" class="login-status" hidden></p>
<p id="phone-login-error" class="login-error" hidden></p> <p id="phone-login-error" class="login-error" hidden></p>
<button id="phone-login-submit" type="submit" class="btn btn-primary login-submit">인증 링크 보내기</button> <button id="phone-login-submit" type="submit" class="btn btn-primary login-submit">인증 링크 보내기</button>
@@ -44,7 +44,7 @@
<header class="main-header"> <header class="main-header">
<div class="header-container" id="nav-container"> <div class="header-container" id="nav-container">
<div class="brand"> <div class="brand">
<img src="/image 92.png" alt="Logo" class="main-logo" /> <img src="/img/image_92.png" alt="Logo" class="main-logo" />
<h1>한맥자산관리시스템</h1> <h1>한맥자산관리시스템</h1>
</div> </div>

View File

@@ -122,6 +122,16 @@ const handleError = (res, err, label) => {
res.status(500).json({ error: err.message }); res.status(500).json({ error: err.message });
}; };
const saveSession = (req) => new Promise((resolve, reject) => {
req.session.save((error) => {
if (error) {
reject(error);
return;
}
resolve();
});
});
// --- Global Constants --- // --- Global Constants ---
const CATEGORY_TABLE_MAP = { const CATEGORY_TABLE_MAP = {
pc: 'asset_core', pc: 'asset_core',
@@ -613,6 +623,8 @@ app.post('/api/auth/headless/login', async (req, res) => {
} }
}; };
await saveSession(req);
res.json({ success: true, user: req.session.user }); res.json({ success: true, user: req.session.user });
} catch (error) { } catch (error) {
console.error('Headless SSO login failed:', error); console.error('Headless SSO login failed:', error);
@@ -629,7 +641,11 @@ app.post('/api/auth/headless/phone/init', async (req, res) => {
try { try {
const pendingLogin = await initHeadlessPhoneLogin({ loginId }); const pendingLogin = await initHeadlessPhoneLogin({ loginId });
req.session.pendingPhoneLogin = pendingLogin; req.session.pendingPhoneLogin = {
...pendingLogin,
startedAt: Date.now()
};
await saveSession(req);
res.json({ res.json({
success: true, success: true,
pendingRef: pendingLogin.pendingRef, pendingRef: pendingLogin.pendingRef,
@@ -670,6 +686,7 @@ app.post('/api/auth/headless/phone/poll', async (req, res) => {
intervalMs: result.intervalMs, intervalMs: result.intervalMs,
startedAt: pendingLogin.startedAt || Date.now() startedAt: pendingLogin.startedAt || Date.now()
}; };
await saveSession(req);
return res.json({ return res.json({
success: true, success: true,
status: 'pending', status: 'pending',
@@ -701,6 +718,8 @@ app.post('/api/auth/headless/phone/poll', async (req, res) => {
} }
}; };
await saveSession(req);
return res.json({ success: true, status: 'authenticated', user: req.session.user }); return res.json({ success: true, status: 'authenticated', user: req.session.user });
} catch (error) { } catch (error) {
console.error('Headless phone login poll failed:', error); console.error('Headless phone login poll failed:', error);