|
@ -153,13 +153,11 @@ class OAuth2Service extends SiteService { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Creates a new OAuth2 client, and generates a Client ID and Secret for it. |
|
|
* Creates a new OAuth2 client, and generates a Client ID and Secret for it. |
|
|
* @param {User} user The authenticated user issuing the request to create an |
|
|
|
|
|
* "app" for use when calling DTP APIs. |
|
|
|
|
|
* @param {Document} clientDefinition The definition of the client to be |
|
|
* @param {Document} clientDefinition The definition of the client to be |
|
|
* created including the name and domain of the node. |
|
|
* created including the name and domain of the node. |
|
|
* @returns new client instance with valid _id. |
|
|
* @returns new client instance with valid _id. |
|
|
*/ |
|
|
*/ |
|
|
async createClient (user, clientDefinition) { |
|
|
async createClient (clientDefinition) { |
|
|
const NOW = new Date(); |
|
|
const NOW = new Date(); |
|
|
const PASSWORD_LEN = parseInt(process.env.DTP_CORE_AUTH_PASSWORD_LEN || '64', 10); |
|
|
const PASSWORD_LEN = parseInt(process.env.DTP_CORE_AUTH_PASSWORD_LEN || '64', 10); |
|
|
|
|
|
|
|
@ -180,9 +178,8 @@ class OAuth2Service extends SiteService { |
|
|
|
|
|
|
|
|
this.log.info('new OAuth2 client created', { |
|
|
this.log.info('new OAuth2 client created', { |
|
|
clientId: client._id, |
|
|
clientId: client._id, |
|
|
owner: user._id, |
|
|
site: client.site.name, |
|
|
node: client.node.name, |
|
|
domain: client.site.domain, |
|
|
domain: client.node.domain, |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
return client.toObject(); |
|
|
return client.toObject(); |
|
|