mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-14 05:45:02 +00:00
Detect expired dashboard logins and redirect to the splash page
This commit is contained in:
parent
f3a90faaa7
commit
8f5a9e607a
4 changed files with 12 additions and 1 deletions
dashboard/src
|
@ -30,6 +30,11 @@ function buildQueryString(params: QueryParamObject) {
|
|||
export function request(resource, fetchOpts: RequestInit = {}) {
|
||||
return fetch(`${apiUrl}/${resource}`, fetchOpts).then(async res => {
|
||||
if (!res.ok) {
|
||||
if (res.status === 401) {
|
||||
RootStore.dispatch("auth/expiredLogin");
|
||||
return;
|
||||
}
|
||||
|
||||
const body = await res.json();
|
||||
throw new ApiError(res.statusText, body, res.status, res);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue