auth0-extensions/auth0-sso-dashboard-extension

View on GitHub
client/selectors/getAppsForConnection.js

Summary

Maintainability
A
0 mins
Test Coverage
import { createSelector } from 'reselect';

const getApps = (state) =>
  state.applications.get('records');

const getConnection = (state, connectionName) =>
connectionName && state.connections.get('records').find(conn => conn.get('name') === connectionName);

const getAppsForConnection = createSelector(
  [ getApps, getConnection ],
  (apps, connection) => apps.filter(app => connection && connection.get('enabled_clients').indexOf(app.get('client_id')) >= 0)
);

export default getAppsForConnection;