const verificationString = await Redis.Instance.setResetPasswordVerificationString(user.id)
const url = WEBSERVER.URL + '/reset-password?userId=' + user.id + '&verificationString=' + verificationString
- await Emailer.Instance.addPasswordResetEmailJob(user.username, user.email, url)
+ Emailer.Instance.addPasswordResetEmailJob(user.username, user.email, url)
return res.status(HttpStatusCode.NO_CONTENT_204).end()
}
return res.status(HttpStatusCode.NO_CONTENT_204).end()
}
+ if (res.locals.user.pluginAuth) {
+ return res.fail({
+ status: HttpStatusCode.CONFLICT_409,
+ message: 'Cannot recover password of a user that uses a plugin authentication.'
+ })
+ }
+
return next()
}
]
return res.status(HttpStatusCode.NO_CONTENT_204).end()
}
+ if (res.locals.user.pluginAuth) {
+ return res.fail({
+ status: HttpStatusCode.CONFLICT_409,
+ message: 'Cannot ask verification email of a user that uses a plugin authentication.'
+ })
+ }
+
return next()
}
]
await server.login.login({ user: { username: 'fry@planetexpress.com', password: 'fry' } })
})
+ it('Should not be able to ask password reset', async function () {
+ await server.users.askResetPassword({ email: 'fry@planetexpress.com', expectedStatus: HttpStatusCode.CONFLICT_409 })
+ })
+
+ it('Should not be able to ask email verification', async function () {
+ await server.users.askSendVerifyEmail({ email: 'fry@planetexpress.com', expectedStatus: HttpStatusCode.CONFLICT_409 })
+ })
+
it('Should not login if the plugin is uninstalled', async function () {
await server.plugins.uninstall({ npmName: 'peertube-plugin-auth-ldap' })