Skip to content

Commit c6d2c8f

Browse files
committed
Don't use cache while authenticating
1 parent 03d4ed7 commit c6d2c8f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/components/Login.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class Login extends React.Component<LoginProps, LoginState> {
4949
query {
5050
me { id name faction avatar isAdmin }
5151
}
52-
`
52+
`,
53+
fetchPolicy: 'no-cache'
5354
});
5455

5556
const user = {

src/components/parts/Layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class AppLayout extends React.Component<AppLayoutProps, AppLayoutState> {
5151
query {
5252
me { id name faction avatar isAdmin }
5353
}
54-
`
54+
`,
55+
fetchPolicy: 'no-cache'
5556
});
5657

5758
const user = result.data.me;

src/components/parts/UserMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class UserMenu extends React.Component<UserMenuProps> {
3434
<Link to={{ pathname: '/login', state: { from: location.pathname } }}>
3535
<Button type="dashed" className="login-btn">
3636
登录
37-
</Button>
37+
</Button>
3838
</Link>
3939
);
4040
}

0 commit comments

Comments
 (0)