fix: data loading after login fixed
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
 | 
			
		||||
import { jwtDecode, JwtPayload as JwtPayloadBase } from "jwt-decode";
 | 
			
		||||
import { OpenAPI } from "../client";
 | 
			
		||||
 | 
			
		||||
interface AuthState {
 | 
			
		||||
    isAuthorized: boolean;
 | 
			
		||||
@@ -38,6 +39,7 @@ const authSlice = createSlice({
 | 
			
		||||
                const { sub, role } = jwtDecode<JwtPayload>(
 | 
			
		||||
                    action.payload.accessToken,
 | 
			
		||||
                );
 | 
			
		||||
                OpenAPI.TOKEN = action.payload.accessToken;
 | 
			
		||||
                state.accessToken = action.payload.accessToken;
 | 
			
		||||
                state.isAuthorized = true;
 | 
			
		||||
                state.role = role;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user