mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-01 08:16:44 +00:00
Return unauthorized if header auth is the only one
This commit is contained in:
@@ -1754,7 +1754,7 @@
|
|||||||
"resourceHeaderAuthSetup": "Header Authentication set successfully",
|
"resourceHeaderAuthSetup": "Header Authentication set successfully",
|
||||||
"resourceHeaderAuthSetupDescription": "Header authentication has been successfully set.",
|
"resourceHeaderAuthSetupDescription": "Header authentication has been successfully set.",
|
||||||
"resourceHeaderAuthSetupTitle": "Set Header Authentication",
|
"resourceHeaderAuthSetupTitle": "Set Header Authentication",
|
||||||
"resourceHeaderAuthSetupTitleDescription": "Set the basic auth credentials (username and password) to protect this resource with HTTP Header Authentication. Leave both fields blank to remove existing header authentication.",
|
"resourceHeaderAuthSetupTitleDescription": "Set the basic auth credentials (username and password) to protect this resource with HTTP Header Authentication. Access it using the format https://username:password@resource.example.com",
|
||||||
"resourceHeaderAuthSubmit": "Set Header Authentication",
|
"resourceHeaderAuthSubmit": "Set Header Authentication",
|
||||||
"actionSetResourceHeaderAuth": "Set Header Authentication",
|
"actionSetResourceHeaderAuth": "Set Header Authentication",
|
||||||
"enterpriseEdition": "Enterprise Edition",
|
"enterpriseEdition": "Enterprise Edition",
|
||||||
|
|||||||
@@ -314,6 +314,11 @@ export async function verifyResourceSession(
|
|||||||
logger.debug("Resource allowed because header auth is valid");
|
logger.debug("Resource allowed because header auth is valid");
|
||||||
return allowed(res);
|
return allowed(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if there are no other auth methods we need to return unauthorized here
|
||||||
|
if (!sso && !pincode && !password && !resource.emailWhitelistEnabled) {
|
||||||
|
return notAllowed(res);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sessions) {
|
if (!sessions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user