Skip to content
Closed
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
4 changes: 1 addition & 3 deletions src/tools/auth0/handlers/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ export default class ConnectionsHandler extends DefaultAPIHandler {
include_totals: true,
});

// Filter out database connections
this.existing = connections.filter((c) => c.strategy !== 'auth0');
if (this.existing === null) return [];
this.existing = connections;

// Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
await this.scimHandler.applyScimConfiguration(this.existing);
Expand Down
3 changes: 3 additions & 0 deletions src/tools/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const DATABASE_SCRIPTS_CHANGE_EMAIL = 'change_email';
const EMAIL_VERIFY = 'verify_email';
const EMAIL_VERIFY_BY_CODE = 'verify_email_by_code';
const EMAIL_RESET = 'reset_email';
const EMAIL_RESET_BY_CODE = 'reset_email_by_code';
const EMAIL_WELCOME = 'welcome_email';
const EMAIL_BLOCKED = 'blocked_account';
const EMAIL_STOLEN_CREDENTIALS = 'stolen_credentials';
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
3 changes: 2 additions & 1 deletion test/tools/auth0/handlers/connections.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('#connections handler', () => {
getAll: (params) =>
mockPagedData(params, 'connections', [
{ strategy: 'github', name: 'github', enabled_clients: [clientId] },
{ strategy: 'auth0', name: 'db-should-be-ignored', enabled_clients: [] },
{ strategy: 'auth0', name: 'db-connection', enabled_clients: [] },
]),
_getRestClient: () => ({}),
},
Expand All @@ -137,6 +137,7 @@ describe('#connections handler', () => {
const data = await handler.getType();
expect(data).to.deep.equal([
{ strategy: 'github', name: 'github', enabled_clients: [clientId] },
{ strategy: 'auth0', name: 'db-connection', enabled_clients: [] },
]);
});

Expand Down
Loading