Skip to content

Commit 2cbfc80

Browse files
author
Jack Blanc
committed
compile error
1 parent 6e16799 commit 2cbfc80

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/auth/ducks/thunks.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ export const signup = (
5252

5353
export const logout = (): UserAuthenticationThunkAction<void> => {
5454
return (dispatch, getState, { authClient, tokenService }): Promise<void> => {
55+
const refreshToken = tokenService.getRefreshToken();
56+
if (refreshToken === null) {
57+
dispatch(logoutUser.loaded());
58+
return Promise.resolve();
59+
}
5560
return authClient
56-
.logout()
61+
.logout(refreshToken)
5762
.then(() => {
5863
tokenService.removeAccessToken();
5964
tokenService.removeRefreshToken();

src/auth/token.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export enum LOCALSTORAGE_TOKEN_KEY {
2525
}
2626

2727
export interface TokenService {
28-
readonly getAccessToken: () => void;
28+
readonly getAccessToken: () => string | null;
2929
readonly setAccessToken: (token: string) => void;
3030
readonly removeAccessToken: () => void;
31-
readonly getRefreshToken: () => void;
31+
readonly getRefreshToken: () => string | null;
3232
readonly setRefreshToken: (token: string) => void;
3333
readonly removeRefreshToken: () => void;
3434
readonly getPrivilegeLevel: () => number;

0 commit comments

Comments
 (0)