mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Migrated authentication.isSetup method to v2
This commit is contained in:
parent
07782d8fa2
commit
4441ee15a0
@ -1,4 +1,5 @@
|
||||
const api = require('./index');
|
||||
const config = require('../../config');
|
||||
const web = require('../../web');
|
||||
const models = require('../../models');
|
||||
const auth = require('../../services/auth');
|
||||
@ -34,6 +35,22 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
isSetup: {
|
||||
permissions: false,
|
||||
query() {
|
||||
return auth.setup.checkIsSetup()
|
||||
.then((isSetup) => {
|
||||
return {
|
||||
status: isSetup,
|
||||
// Pre-populate from config if, and only if the values exist in config.
|
||||
title: config.title || undefined,
|
||||
name: config.user_name || undefined,
|
||||
email: config.user_email || undefined
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
generateResetToken: {
|
||||
permissions: true,
|
||||
options: [
|
||||
|
@ -11,6 +11,12 @@ module.exports = {
|
||||
};
|
||||
},
|
||||
|
||||
isSetup(data, apiConfig, frame) {
|
||||
frame.response = {
|
||||
setup: [data]
|
||||
};
|
||||
},
|
||||
|
||||
acceptInvitation(data, apiConfig, frame) {
|
||||
debug('acceptInvitation');
|
||||
|
||||
|
@ -191,7 +191,7 @@ module.exports = function apiRoutes() {
|
||||
router.get('/authentication/invitation', api.http(apiv2.authentication.isInvitation));
|
||||
router.post('/authentication/setup', api.http(apiv2.authentication.setup));
|
||||
router.put('/authentication/setup', mw.authAdminApi, api.http(api.authentication.updateSetup));
|
||||
router.get('/authentication/setup', api.http(api.authentication.isSetup));
|
||||
router.get('/authentication/setup', api.http(apiv2.authentication.isSetup));
|
||||
|
||||
// ## Images
|
||||
router.post('/images/upload',
|
||||
|
Loading…
Reference in New Issue
Block a user