Skip to content

Commit

Permalink
[#24] Feat: 로그인 성공시 token을 쿠키에 저장
Browse files Browse the repository at this point in the history
  • Loading branch information
LDH98 committed May 31, 2024
1 parent 602301d commit a099d44
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pages/start-family/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import LinkList from '@/components/start-family/link-list/link-list';
import IntroduceText from '@/components/start-family/introduce-text/introduce-text';
import styles from './index.module.scss';
import { useEffect } from 'react';
import { useRouter } from 'next/router';
import { setCookie } from 'cookies-next';

export default function StartFamily() {
const {
query: { token },
isReady,
} = useRouter();

useEffect(() => {
if (!isReady) return;
if (token) {
setCookie('accessToken', token);
}
}, [isReady]);

return (
<article className={styles.article}>
<IntroduceText />
Expand Down

0 comments on commit a099d44

Please sign in to comment.