Skip to content

Commit 74b6495

Browse files
committed
refactor: resolved token management process in login form copilot
1 parent ff53551 commit 74b6495

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ui/src/pages/Login/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,10 @@ const Login: FC<IProps> = () => {
153153
setIsLoading(false);
154154
failtureNotification(response?.data?.error_message || response?.data?.error?.message);
155155
}
156-
156+
dispatch(clearAuthToken());
157+
localStorage?.removeItem('app_token');
157158
if (response?.status === 200 && response?.data?.message === LOGIN_SUCCESSFUL_MESSAGE) {
158159
setIsLoading(false);
159-
dispatch(clearAuthToken());
160-
localStorage?.removeItem('app_token');
161160
setDataInLocalStorage('app_token', response?.data?.app_token);
162161

163162
// Clear any previous organization data to ensure fresh organization selection for new user

0 commit comments

Comments
 (0)