Skip to content

Commit

Permalink
feat: 로그인 상태로 접근 시 리다이렉트
Browse files Browse the repository at this point in the history
  • Loading branch information
HaydenDevK committed Oct 15, 2023
1 parent 1a4bcac commit 0bc5b12
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utils/signin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
goToFolderPage,
getPasswordVisibility,
getIsFilledEmail,
getIsValidEmail,
Expand All @@ -13,6 +14,15 @@ import {

import { signIn } from "./api.js";

/* 로그인 상태로 접근 시 리다이렉트 */
(function () {
const accessToken = localStorage.getItem("accessToken");

if (accessToken) {
goToFolderPage();
}
})();

/* 비밀번호 토글 */
const passwordToggleElement = document.querySelector(".auth__toggle-password");

Expand Down
9 changes: 9 additions & 0 deletions utils/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ import { signUp } from "./api.js";

import { getIsNewEmail } from "/utils/api.js";

/* 로그인 상태로 접근 시 리다이렉트 */
(function () {
const accessToken = localStorage.getItem("accessToken");

if (accessToken) {
goToFolderPage();
}
})();

/* 비밀번호 토글 */
const confirmPasswordToggleElement = document.querySelector(
".auth__toggle-password--confirm"
Expand Down

0 comments on commit 0bc5b12

Please sign in to comment.