feat(web): add auth and home pages

This commit is contained in:
dahyeon committed 2026-04-11 02:31:00 +09:00
1 parent 9fbb11c634
commit 3a86676a12
3 files changed
+319

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
import { useMsal } from "@azure/msal-react";
import {
isMsalConfigured,
MSAL_API_SCOPE,
msalInstance,
} from "../lib/auth/msal.config";
function LoginButton() {
const { instance } = useMsal();
return (
<button
type="button"
className="btn btn-primary btn-sm px-5"
onClick={() =>
void instance.loginRedirect({
scopes: [MSAL_API_SCOPE],
prompt: "select_account",
})
}
>
Entra ID 로 로그인
</button>
);
}
export default function LoginPage() {
return (
<main className="max-w-5xl mx-auto px-4 sm:px-6 py-20">
<div className="max-w-md border border-base-content/10 bg-base-100 p-6 shadow-sm">
<h1 className="text-xl font-bold tracking-tight">로그인</h1>
<p className="mt-2 text-sm text-base-content/50">
Entra ID 계정으로 LOLYMPUS 정보를 불러옵니다.
</p>
<div className="mt-5">
{isMsalConfigured && msalInstance ? (
<LoginButton />
) : (
<div className="text-sm text-amber-600">
MSAL 환경변수 설정이 필요합니다.
</div>
)}
</div>
</div>
</main>
);
}