mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
17 lines
654 B
TypeScript
17 lines
654 B
TypeScript
import { useAuthStore } from '/@/renderer/store';
|
|
import { toast } from '/@/shared/components/toast/toast';
|
|
import { ServerListItem } from '/@/shared/types/types';
|
|
|
|
export const authenticationFailure = (currentServer: null | ServerListItem) => {
|
|
toast.error({
|
|
message: 'Your session has expired.',
|
|
});
|
|
|
|
if (currentServer) {
|
|
const serverId = currentServer.id;
|
|
const token = currentServer.ndCredential;
|
|
console.log(`token is expired: ${token}`);
|
|
useAuthStore.getState().actions.updateServer(serverId, { ndCredential: undefined });
|
|
useAuthStore.getState().actions.setCurrentServer(null);
|
|
}
|
|
};
|