mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
add user account email verificiation (#977)
* add user account email verificiation includes server and client code to: * enable verificationRequired via custom config * send verification email with registration * ask for verification email * verify via email * prevent login if not verified and required * conditional client links to ask for new verification email * allow login for verified=null these are users created when verification not required should still be able to login when verification is enabled * refactor email verifcation pr * change naming from verified to emailVerified * change naming from askVerifyEmail to askSendVerifyEmail * undo unrelated automatic prettier formatting on api/config * use redirectService for home * remove redundant success notification on email verified * revert test.yaml smpt host
This commit is contained in:
@@ -737,6 +737,28 @@ describe('Test users API validators', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('When asking for an account verification email', function () {
|
||||
const path = '/api/v1/users/ask-send-verify-email'
|
||||
|
||||
it('Should fail with a missing email', async function () {
|
||||
const fields = {}
|
||||
|
||||
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
|
||||
})
|
||||
|
||||
it('Should fail with an invalid email', async function () {
|
||||
const fields = { email: 'hello' }
|
||||
|
||||
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
|
||||
})
|
||||
|
||||
it('Should succeed with the correct params', async function () {
|
||||
const fields = { email: 'admin@example.com' }
|
||||
|
||||
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields, statusCodeExpected: 204 })
|
||||
})
|
||||
})
|
||||
|
||||
after(async function () {
|
||||
killallServers([ server, serverWithRegistrationDisabled ])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user