260904_01_ENH: 로그인 화면에 ip와 자리번호 노출 #30
@@ -9,17 +9,25 @@ import {useRouter} from "next/navigation";
|
||||
import {apiError} from "@kri/common/http";
|
||||
import {NONE_HTTP_ERROR} from "@kri/common/http";
|
||||
import {useLoginMutation} from "@/query/auth";
|
||||
import {useInternalInfoQuery} from "@/query/internal";
|
||||
import {cn} from "@/lib/utils";
|
||||
|
||||
const LoginPage = () => {
|
||||
const router = useRouter();
|
||||
|
||||
const loginMutation = useLoginMutation();
|
||||
const internalInfoQuery = useInternalInfoQuery(true);
|
||||
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const [userId, setUserId] = useState<string>("");
|
||||
const [userPw, setUserPw] = useState<string>("");
|
||||
|
||||
const clientIp = internalInfoQuery.data?.clientIp || "";
|
||||
const clientId = internalInfoQuery.data?.clientId || "";
|
||||
const isCallSeat = clientIp.startsWith("10.10.15");
|
||||
const isCallSeatAndUnable = isCallSeat && clientId === "";
|
||||
|
||||
const passwordInputRef = useRef<HTMLInputElement | null>(null);
|
||||
|
||||
const tryLogin = async () => {
|
||||
@@ -107,7 +115,12 @@ const LoginPage = () => {
|
||||
ref={passwordInputRef}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="text-base">
|
||||
IP: {clientIp}
|
||||
</p>
|
||||
<p className={cn("text-base", isCallSeatAndUnable && "font-bold text-red-500")}>
|
||||
{isCallSeatAndUnable? "전화걸기 이용 불가(관리자에게 문의해 주세요)" : `자리번호: ${clientId}`}
|
||||
</p>
|
||||
{error && (
|
||||
<p className="text-sm text-red-500">
|
||||
{error}
|
||||
@@ -116,7 +129,7 @@ const LoginPage = () => {
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-full mt-6 h-11"
|
||||
className="w-full mt-3 h-11"
|
||||
disabled={loginMutation.isPending}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user