mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
web/lib/api: return errors from authorization function
This commit is contained in:
parent
6bb412852d
commit
d8f3bbe0f3
@ -41,8 +41,6 @@ const getAuthorization = async () => {
|
||||
if (processing.enableCustomApiKey && processing.customApiKey.length > 0) {
|
||||
return `Api-Key ${processing.customApiKey}`;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const request = async (url: string) => {
|
||||
@ -86,7 +84,11 @@ const request = async (url: string) => {
|
||||
const api = currentApiURL();
|
||||
const authorization = await getAuthorization();
|
||||
|
||||
let extraHeaders = {}
|
||||
if (authorization && typeof authorization !== "string") {
|
||||
return authorization;
|
||||
}
|
||||
|
||||
let extraHeaders = {};
|
||||
|
||||
if (authorization) {
|
||||
extraHeaders = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user