Skip to content

feat(auth): remove USER_WAS_UNAUTHORIZED event handling and related logic#265

Open
egalvis27 wants to merge 3 commits intomainfrom
feat/remove-unauthorized-event
Open

feat(auth): remove USER_WAS_UNAUTHORIZED event handling and related logic#265
egalvis27 wants to merge 3 commits intomainfrom
feat/remove-unauthorized-event

Conversation

@egalvis27
Copy link

What is Changed / Added


Why

Comment on lines +34 to +39
export function onUserUnauthorized() {
eventBus.emit('USER_WAS_UNAUTHORIZED');

logout();
logger.debug({
msg: '[AUTH] User has been logged out because it was unauthorized',
});
setIsLoggedIn(false);
logout();
}

ipcMain.on('user-is-unauthorized', onUserUnauthorized);

ipcMain.on('user-logged-out', () => {
eventBus.emit('USER_LOGGED_OUT');

setIsLoggedIn(false);

logout();
});
ipcMain.on('user-logged-out', onUserUnauthorized);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the method so that it better reflects the behaviour

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

import { AuthorizedClients } from './Clients';

export const onUserUnauthorized = () => ipcRenderer.emit('user-is-unauthorized');
export const onUserUnauthorized = () => ipcRenderer.send('user-logged-out');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@egalvis27 egalvis27 force-pushed the feat/remove-unauthorized-event branch from a0e9aa1 to d7c5bbb Compare March 11, 2026 13:48
@sonarqubecloud
Copy link

@egalvis27 egalvis27 requested a review from AlexisMora March 11, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants