mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
more robust oauth
This commit is contained in:
@@ -71,10 +71,15 @@ export async function apiCall(route: string, args: {} = undefined) {
|
||||
});
|
||||
|
||||
if (resp.status == 401 && !apiDisabled) {
|
||||
const params = new URLSearchParams(location.search);
|
||||
|
||||
disableApi();
|
||||
console.log('Disabling API', route);
|
||||
// unauthorized
|
||||
redirectToLogin();
|
||||
if (params.get('page') != 'login' && params.get('page') != 'not-logged') {
|
||||
// unauthorized
|
||||
redirectToLogin();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const json = await resp.json();
|
||||
|
||||
Reference in New Issue
Block a user