mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
reload the window on 401
This commit is contained in:
parent
a70dd02788
commit
c708953342
@ -24,6 +24,11 @@ export function ApiProvider({ children, options }: ApiProviderType) {
|
||||
const [path, params] = Array.isArray(key) ? key : [key, undefined];
|
||||
return axios.get(path, { params }).then((res) => res.data);
|
||||
},
|
||||
onError: (error, _key) => {
|
||||
if (error.status === 401) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
...options,
|
||||
}}
|
||||
>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user