Fix ND potentially setting undefined undefined credential (#60)

This commit is contained in:
jeffvli 2023-05-24 00:33:35 -07:00
parent 0103a84358
commit 76805a0b19

View file

@ -173,9 +173,13 @@ axiosClient.interceptors.response.use(
const serverId = useAuthStore.getState().currentServer?.id; const serverId = useAuthStore.getState().currentServer?.id;
if (serverId) { if (serverId) {
useAuthStore.getState().actions.updateServer(serverId, { const headerCredential = response.headers['x-nd-authorization'] as string | undefined;
ndCredential: response.headers['x-nd-authorization'] as string,
}); if (headerCredential) {
useAuthStore.getState().actions.updateServer(serverId, {
ndCredential: headerCredential,
});
}
} }
return response; return response;