-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add filter:api.user.signup.requires-approval.result
closes #6691
- Loading branch information
1 parent
d16d2e6
commit b1b8810
Showing
12 changed files
with
208 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/models/src/users/registration/user-registration.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,56 @@ describe('Test registrations', function () { | |
}) | ||
}) | ||
|
||
describe('Deprecated registration requests', function () { | ||
before(async function () { | ||
this.timeout(60000) | ||
|
||
await server.config.enableSignup(true) | ||
|
||
{ | ||
await server.registrations.requestRegistration({ | ||
username: 'deprecated_user4', | ||
email: '[email protected]', | ||
registrationReason: 'registration reason 4' | ||
}) | ||
} | ||
}) | ||
|
||
it('Should request a registration without a channel', async function () { | ||
{ | ||
await server.registrations.requestRegistration({ | ||
username: 'deprecated_user2', | ||
displayName: 'my super deprecated_user 2', | ||
email: '[email protected]', | ||
password: 'deprecated_user2password', | ||
registrationReason: 'registration reason 2' | ||
}) | ||
} | ||
}) | ||
|
||
it('Should request a registration with a channel', async function () { | ||
await server.registrations.requestRegistration({ | ||
username: 'deprecated_user3', | ||
displayName: 'my super deprecated_user 3', | ||
channel: { | ||
displayName: 'my deprecated_user 3 channel', | ||
name: 'super_deprecated_user3_channel' | ||
}, | ||
email: '[email protected]', | ||
password: 'deprecated_user3password', | ||
registrationReason: 'registration reason 3' | ||
}) | ||
}) | ||
|
||
after(async function () { | ||
const registrations = await server.registrations.list() | ||
|
||
for (const reg of registrations.data) { | ||
await server.registrations.delete({ id: reg.id }) | ||
} | ||
}) | ||
}) | ||
|
||
describe('Registration requests', function () { | ||
let id2: number | ||
let id3: number | ||
|
@@ -90,31 +140,33 @@ describe('Test registrations', function () { | |
await server.config.enableSignup(true) | ||
|
||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
username: 'user4', | ||
registrationReason: 'registration reason 4' | ||
}) | ||
const registrations = await server.registrations.list() | ||
|
||
id4 = id | ||
id4 = registrations.data[0].id | ||
} | ||
}) | ||
|
||
it('Should request a registration without a channel', async function () { | ||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
username: 'user2', | ||
displayName: 'my super user 2', | ||
email: '[email protected]', | ||
password: 'user2password', | ||
registrationReason: 'registration reason 2' | ||
}) | ||
const registrations = await server.registrations.list() | ||
|
||
id2 = id | ||
id2 = registrations.data[0].id | ||
} | ||
}) | ||
|
||
it('Should request a registration with a channel', async function () { | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
username: 'user3', | ||
displayName: 'my super user 3', | ||
channel: { | ||
|
@@ -126,7 +178,8 @@ describe('Test registrations', function () { | |
registrationReason: 'registration reason 3' | ||
}) | ||
|
||
id3 = id | ||
const registrations = await server.registrations.list() | ||
id3 = registrations.data[0].id | ||
}) | ||
|
||
it('Should list these registration requests', async function () { | ||
|
@@ -336,20 +389,22 @@ describe('Test registrations', function () { | |
let id2: number | ||
|
||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
username: 'user7', | ||
email: '[email protected]', | ||
registrationReason: 'tt' | ||
}) | ||
id1 = id | ||
const registrations = await server.registrations.list() | ||
id1 = registrations.data[0].id | ||
} | ||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
username: 'user8', | ||
email: '[email protected]', | ||
registrationReason: 'tt' | ||
}) | ||
id2 = id | ||
const registrations = await server.registrations.list() | ||
id2 = registrations.data[0].id | ||
} | ||
|
||
await server.registrations.accept({ id: id1, moderationResponse: 'tt', preventEmailDelivery: true }) | ||
|
@@ -370,7 +425,7 @@ describe('Test registrations', function () { | |
let id2: number | ||
|
||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
registrationReason: 'tt', | ||
username: 'user5', | ||
password: 'user5password', | ||
|
@@ -380,17 +435,19 @@ describe('Test registrations', function () { | |
} | ||
}) | ||
|
||
id1 = id | ||
const registrations = await server.registrations.list() | ||
id1 = registrations.data[0].id | ||
} | ||
|
||
{ | ||
const { id } = await server.registrations.requestRegistration({ | ||
await server.registrations.register({ | ||
registrationReason: 'tt', | ||
username: 'user6', | ||
password: 'user6password' | ||
}) | ||
|
||
id2 = id | ||
const registrations = await server.registrations.list() | ||
id2 = registrations.data[0].id | ||
} | ||
|
||
await server.registrations.accept({ id: id1, moderationResponse: 'tt' }) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.