mirror of
https://github.com/strapi/strapi.git
synced 2025-10-17 02:53:22 +00:00
Add security to ensure the admin is available
This commit is contained in:
parent
ce02440ba5
commit
d0268ad397
@ -12,6 +12,7 @@ const {
|
||||
get,
|
||||
difference,
|
||||
intersection,
|
||||
isEmpty,
|
||||
isObject,
|
||||
isFunction,
|
||||
} = require('lodash');
|
||||
@ -28,6 +29,10 @@ module.exports = {
|
||||
*/
|
||||
async isInitialised(strapi) {
|
||||
try {
|
||||
if (isEmpty(strapi.admin)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const numberOfAdministrators = await strapi
|
||||
.query('administrator', 'admin')
|
||||
.find({ _limit: 1 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user