Fix ND potentially setting undefined undefined credential (#60)
This commit is contained in:
parent
0103a84358
commit
76805a0b19
1 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Reference in a new issue