Fixes for "validate email" & "send validation email" in ACP (#11677)

* confirmObj changes

dont expire confirm:<code>, add a expires field instead
dont expire confirm:byUid:<uid>

on admin manage users display the users email status
	1. verified
	2. verify email sent (pending)
	3. verify email sent (expired)
	4. no email entered

fix validate email in acp to use
	email in user:<uid> if they have one
	if not check if its in confirm:<code>
	if its not in above cant validate throw error

fix send validate email to use
	email in user:<uid> if they have one
	if not check if its in confirm:<code>
	if its not in above too cant validate throw error

* add back socket.io tests

* test: fix confirm tests

no longer using pexpire
return correct time left on token

* chore: update openapi

* fix: delete call

* test: mget test fixes

* test: fix tests
This commit is contained in:
Barış Soner Uşaklı
2023-06-05 12:12:48 -04:00
committed by GitHub
parent 1e137b0705
commit 04998908ba
13 changed files with 144 additions and 25 deletions

View File

@@ -35,6 +35,17 @@ describe('Key methods', () => {
});
});
it('should return multiple keys and null if key doesn\'t exist', async () => {
const data = await db.mget(['doesnotexist', 'testKey']);
assert.deepStrictEqual(data, [null, 'testValue']);
});
it('should return empty array if keys is empty array or falsy', async () => {
assert.deepStrictEqual(await db.mget([]), []);
assert.deepStrictEqual(await db.mget(false), []);
assert.deepStrictEqual(await db.mget(null), []);
});
it('should return true if key exist', (done) => {
db.exists('testKey', function (err, exists) {
assert.ifError(err);
@@ -351,3 +362,4 @@ describe('Key methods', () => {
});
});
});