Skip to content

Commit

Permalink
fix: don't call clearAllCaches in auth
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Sep 21, 2024
1 parent f5167e8 commit c43073f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions src/app/auth/[[...path]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ import { EmailPasswordPreBuiltUI } from 'supertokens-auth-react/recipe/emailpass
import { EmailVerificationPreBuiltUI } from 'supertokens-auth-react/recipe/emailverification/prebuiltui';
import SuperTokens from 'supertokens-auth-react/ui';

import { clearAllCaches } from '../../../asyncFunctions/cache/actions';

const AuthPage: NextPage = () => {
// if the user visits a page that is not handled by us (like /auth/random), then we redirect them back to the auth page.
const [loaded, setLoaded] = useState(false);

useEffect(() => {
// サインイン/アップに伴う画面表示の変更を反映するために、全ページのキャッシュを削除する。
void clearAllCaches();

if (SuperTokens.canHandleRoute([EmailPasswordPreBuiltUI, EmailVerificationPreBuiltUI])) {
setLoaded(true);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/SignOutMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react';
import { MdOutlineLogout } from 'react-icons/md';
import { signOut } from 'supertokens-auth-react/recipe/session';

import { clearAllCaches } from '../../asyncFunctions/cache/actions';
import { clearAllCaches } from '../../actions';
import { Icon, MenuItem } from '../../infrastructures/useClient/chakra';

export const SignOutMenuItem: React.FC = () => {
Expand Down

0 comments on commit c43073f

Please sign in to comment.