Skip to content

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

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

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

Conversation

@egalvis27
Copy link

What is Changed / Added


Why

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 2026

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

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

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