mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Improved error messages for failed authorization
This commit is contained in:
parent
03d4843628
commit
288a38036b
2 changed files with 7 additions and 3 deletions
|
@ -52,7 +52,8 @@ const authorize = {
|
|||
return next();
|
||||
}
|
||||
return next(new common.errors.NoPermissionError({
|
||||
message: common.i18n.t('errors.middleware.auth.pleaseSignInOrAuthenticate')
|
||||
message: common.i18n.t('errors.middleware.auth.authorizationFailed'),
|
||||
context: common.i18n.t('errors.middleware.auth.missingContentMemberOrIntegration')
|
||||
}));
|
||||
},
|
||||
|
||||
|
@ -70,7 +71,8 @@ const authorize = {
|
|||
return next();
|
||||
} else {
|
||||
return next(new common.errors.NoPermissionError({
|
||||
message: common.i18n.t('errors.middleware.auth.pleaseSignInOrAuthenticate')
|
||||
message: common.i18n.t('errors.middleware.auth.authorizationFailed'),
|
||||
context: common.i18n.t('errors.middleware.auth.missingAdminUserOrIntegration')
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,9 @@
|
|||
"missingUserIDForSession": "Cannot create session without user id.",
|
||||
"accessDenied": "Access denied.",
|
||||
"pleaseSignIn": "Please Sign In",
|
||||
"pleaseSignInOrAuthenticate": "Please sign in or authenticate with an API Key",
|
||||
"authorizationFailed": "Authorization failed",
|
||||
"missingContentMemberOrIntegration": "Unable to determine the authenticated member or integration. Check the supplied Content API Key and ensure cookies are being passed through if member auth is failing.",
|
||||
"missingAdminUserOrIntegration": "Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication.",
|
||||
"adminApiKeyMissing": "Admin API Key missing.",
|
||||
"unknownAdminApiKey": "Unknown Admin API Key",
|
||||
"unknownContentApiKey": "Unknown Content API Key",
|
||||
|
|
Loading…
Add table
Reference in a new issue