Revize 84b0fbc3
Přidáno uživatelem Fantič před téměř 2 roky(ů)
src/stores/actions/userThunks.ts | ||
---|---|---|
23 | 23 |
|
24 | 24 |
export const checkAuth = createAsyncThunk( |
25 | 25 |
"user/isauth", |
26 |
async (payload: { |
|
27 |
isauth: boolean |
|
28 |
}) => { |
|
26 |
async () => { |
|
29 | 27 |
try { |
30 | 28 |
const response = await isAuthRequest() |
31 | 29 |
console.log(response) |
32 | 30 |
if (response.status === 200) { |
33 | 31 |
return { |
34 |
isLogged: payload.isauth
|
|
32 |
isLogged: response.data.isauth
|
|
35 | 33 |
} |
36 | 34 |
} else { |
37 | 35 |
return Promise.reject(response.data ? response.data : "Check authentication failed") |
Také k dispozici: Unified diff
#re 10343 checkAuth fix