refactorin docker files

This commit is contained in:
les
2019-09-25 14:38:16 +02:00
parent 803a217122
commit d2f08d3412
9 changed files with 24 additions and 46 deletions

View File

@@ -11,6 +11,7 @@ const settingsController = require('./settings')
const federation = require('../../federation/helpers')
const util = require('util')
const generateKeyPair = util.promisify(crypto.generateKeyPair)
const debug = require('debug')('user:controller')
const userController = {
async login (req, res) {
@@ -237,22 +238,6 @@ const userController = {
if (!req.body.password) { delete req.body.password }
// generate an rsa key in case not present
if (!user.rsa) {
const rsa = await generateKeyPair('rsa', {
modulusLength: 4096,
publicKeyEncoding: {
type: 'spki',
format: 'pem'
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem'
}
})
req.body.rsa = rsa
}
await user.update(req.body)
if (!user.is_active && req.body.is_active && user.recover_code) {