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