Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reset_email_by_code template #1014

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class ConnectionsHandler extends DefaultAPIHandler {
include_totals: true,
});

// Filter out database connections
// Filter out database connections as we have separate handler for it
this.existing = connections.filter((c) => c.strategy !== 'auth0');
if (this.existing === null) return [];

Expand Down
3 changes: 3 additions & 0 deletions src/tools/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const EMAIL_VERIFY = 'verify_email';
const EMAIL_VERIFY_BY_CODE = 'verify_email_by_code';
const EMAIL_RESET = 'reset_email';
const EMAIL_WELCOME = 'welcome_email';
const EMAIL_RESET_BY_CODE = 'reset_email_by_code';
const EMAIL_BLOCKED = 'blocked_account';
const EMAIL_STOLEN_CREDENTIALS = 'stolen_credentials';
const EMAIL_ENROLLMENT = 'enrollment_email';
Expand Down Expand Up @@ -155,6 +156,8 @@ const constants = {
`${EMAIL_VERIFY_BY_CODE}.html`,
`${EMAIL_RESET}.json`,
`${EMAIL_RESET}.html`,
`${EMAIL_RESET_BY_CODE}.json`,
`${EMAIL_RESET_BY_CODE}.html`,
`${EMAIL_WELCOME}.json`,
`${EMAIL_WELCOME}.html`,
`${EMAIL_BLOCKED}.json`,
Expand Down
11 changes: 11 additions & 0 deletions test/tools/auth0/handlers/databases.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ describe('#databases handler', () => {

await stageFn.apply(handler, [assets]);
});

it('should update database when attributes are passed', async () => {
const auth0 = {
connections: {
Expand Down Expand Up @@ -482,6 +483,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method: 'otp',
},
username: {
signup: {
Expand Down Expand Up @@ -534,6 +536,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method: 'otp',
},
username: {
signup: {
Expand All @@ -558,6 +561,7 @@ describe('#databases handler', () => {

await stageFn.apply(handler, [{ databases: data }]);
});

it('should update database when require username and validation are passed', async () => {
const auth0 = {
connections: {
Expand Down Expand Up @@ -861,6 +865,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method:'link'
},
username: {
signup: {
Expand Down Expand Up @@ -1061,6 +1066,7 @@ describe('#databases handler', () => {
// eslint-disable-next-line no-unused-expressions
expect(updateArgs.options.requires_username).to.exist;
});

it('should update database when attributes are passed', async () => {
const auth0 = {
connections: {
Expand Down Expand Up @@ -1092,6 +1098,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method:'otp',
},
username: {
signup: {
Expand Down Expand Up @@ -1144,6 +1151,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method: 'otp',
},
username: {
signup: {
Expand All @@ -1168,6 +1176,7 @@ describe('#databases handler', () => {

await stageFn.apply(handler, [{ databases: data }]);
});

it('should update database when require username and validation are passed', async () => {
const auth0 = {
connections: {
Expand Down Expand Up @@ -1316,6 +1325,7 @@ describe('#databases handler', () => {
identifier: {
active: true,
},
verification_method: 'link',
profile_required: true,
},
username: {
Expand Down Expand Up @@ -1471,6 +1481,7 @@ describe('#databases handler', () => {
active: true,
},
profile_required: true,
verification_method:'link',
},
username: {
signup: {
Expand Down
Loading