mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Improved error messages for failed authorization
This commit is contained in:
parent
03d4843628
commit
288a38036b
@ -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…
Reference in New Issue
Block a user