첫 메인 화면 $isLogin 인증 부분 궁금한점이 있습니다.
해결됨
Svelte REST-API 프로젝트
처음 화면에서 http://127.0.0.1:3012 을 호출하면 http://127.0.0.1:3012/articles/all 주소로 자동 이동합니다. 궁금한 점은 articles/all 화면에서 제일 상단에 인증되면 보이는 입력칸이 보입니다. {#if $isLogin} 으로 조건이 되어도 true 인지 입력칸이 보입니다. 로그아웃 버튼을 누르면 로그인을 하지 않은 첫화면인데 작동이 되어 로그아웃으로 해제 됩니다. 이 부분이 궁금합니다. <script> import ArticleHeader from '../components/ArticleHeader.svelte'; import ArticleList from '../components/ArticleList.svelte' import ArticleAddForm from '../components/ArticleAddForm.svelte' import Comments from '../pages/Comments.svelte' import { isLogin } from '../stores' import { Route } from 'tinro' </script> <ArticleHeader /> <main class="slog-main "> {#if $isLogin} <ArticleAddForm /> {/if} <ArticleList /> <Route path="/comments/:id" > <Comments /> </Route> </main> function setIsLogin() { const checkLogin = derived(auth, $auth => $auth.Authorization ? true : false) return checkLogin }
- rest-api
- svelte
- 인증
- islogin





