Skip to content

Instantly share code, notes, and snippets.

@iezer
Created March 2, 2018 21:53
Show Gist options
  • Save iezer/3858a169c0610dffbc7d852ac572c2ef to your computer and use it in GitHub Desktop.
Save iezer/3858a169c0610dffbc7d852ac572c2ef to your computer and use it in GitHub Desktop.
Module Unification ember app that uses ember-simple-auth and ember-cli-flash
// /src/resolver.js file in Module Unification ember app that uses ember-simple-auth and ember-cli-flash
import Resolver from 'ember-resolver/resolvers/fallback';
import buildResolverConfig from 'ember-resolver/ember-config';
import config from '../config/environment';
import { merge } from '@ember/polyfills';
let moduleConfig = buildResolverConfig(config.modulePrefix);
/*
* If your application has custom types and collections, modify moduleConfig here
* to add support for them.
*/
/* types for ember-simple-auth */
merge(moduleConfig.types, {
session: { definitiveCollection: 'main' },
authenticator: { definitiveCollection: 'authenticators' },
authorizer: { definitiveCollection: 'authorizers' },
'session-store': { definitiveCollection: 'main' }
});
moduleConfig.collections.main.types.push('session', 'session-store');
merge(moduleConfig.collections, {
authenticators: {
group: 'simple-auth',
defaultType: 'authenticator',
types: ['authenticator']
},
authorizers: {
group: 'simple-auth',
defaultType: 'authorizer',
types: ['authorizer']
}
});
/* types for ember-cli-flash */
merge(moduleConfig.types, {
config: { definitiveCollection: 'main' }
});
moduleConfig.collections.main.types.push('config');
export default Resolver.extend({
config: moduleConfig
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment