Skip to content

Commit

Permalink
feat: ut용 다이렉트 로그인 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
im-na0 committed Mar 6, 2024
1 parent 9edc8c2 commit 26b931d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/signInPage/SignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { postLogin } from "@apis/fetchLogin";
import { PATH } from "@constants/path";
import useToastConfig from "@hooks/common/useToastConfig";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { Link, useNavigate, useSearchParams } from "react-router-dom";

Expand All @@ -18,6 +19,7 @@ const SignIn = () => {
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const redirectUrl = searchParams.get("redirect");
const directUrl = searchParams.get("direct");
const { handleToast } = useToastConfig();

const {
Expand All @@ -31,6 +33,15 @@ const SignIn = () => {
},
});

useEffect(() => {
// TODO: UT용 다이렉트 로그인 처리
if (directUrl === "login") {
const email = "[email protected]";
const password = "qwerty123@";
handleOnSubmit({ email, password });
}
}, [directUrl]);

const handleOnSubmit = async (data: FormValues) => {
const { email, password } = data;

Expand Down

0 comments on commit 26b931d

Please sign in to comment.