From 95572992de322664e28ce4502c7b7e34dcc4718e Mon Sep 17 00:00:00 2001 From: Alan Potter Date: Wed, 30 Oct 2024 04:55:32 -0400 Subject: [PATCH] fix: handle missing API key When the user hasn't provided an API key for Navie, the RPC client currently returns a 500 error code with a message, instead of a 401. Handle this error, so the UI will be updated appropriately. --- packages/components/src/components/chat/Chat.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/src/components/chat/Chat.vue b/packages/components/src/components/chat/Chat.vue index 21534238e9..624b262a72 100644 --- a/packages/components/src/components/chat/Chat.vue +++ b/packages/components/src/components/chat/Chat.vue @@ -287,7 +287,10 @@ export default { this.messages.splice(messageIndex, 1); } - if (error.code === 401) { + if ( + error.code === 401 || + (error.code === 500 && error.message === 'Authentication required') + ) { this.setAuthorized(false); } else { this.addErrorMessage(error);