do not set recover_code during user registration

This commit is contained in:
lesion 2022-06-28 13:34:30 +02:00
parent 176de89747
commit 80e9d8a11e
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -80,7 +80,6 @@ const userController = {
if (!settingsController.settings.allow_registration) { return res.sendStatus(404) } if (!settingsController.settings.allow_registration) { return res.sendStatus(404) }
const n_users = await User.count() const n_users = await User.count()
try { try {
req.body.recover_code = crypto.randomBytes(16).toString('hex')
// the first registered user will be an active admin // the first registered user will be an active admin
if (n_users === 0) { if (n_users === 0) {
@ -104,7 +103,7 @@ const userController = {
res.sendStatus(200) res.sendStatus(200)
} catch (e) { } catch (e) {
log.error('Registration error:', e) log.error('Registration error:', e)
res.status(404).json(e) res.status(400).json(e)
} }
}, },