mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 13:00:13 +02:00
18 lines
656 B
TypeScript
18 lines
656 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.error(`token is expired: ${token}`);
|
|
useAuthStore.getState().actions.updateServer(serverId, { ndCredential: undefined });
|
|
useAuthStore.getState().actions.setCurrentServer(null);
|
|
}
|
|
};
|