Skip to content

Task Done Single source for with without login

Don edited this page Oct 15, 2021 · 1 revision

setup alternate build for the non-security version of Pretzel;

+ Done (configured via backend env options EMAIL_VERIFY=NONE AUTH=ALL)

implementation used : routes/mapview.js if (window['AUTH'] !== 'NONE') { args.unshift(AuthenticatedRouteMixin); }

adapters/application.js if (window['AUTH'] !== 'NONE'){ args.unshift(DataAdapterMixin); }

components/record/entry-base.js noAuth: function() { return window['AUTH'] === 'NONE' },

templates/components/record/entry-dataset.hbs:61: {{#if noAuth}} templates/components/record/entry-record.hbs:60: {{#if noAuth}}


earlier ideas : based on some build configuration or a simple setup command, the frontend api sources will use either : ... import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';n ... import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; One way would be to have alternate files for the the 2 versions, e.g. https://github.com/minichate/ember-cli-conditional-compile Another alternative is to define blueprints for the alternatives; https://ember-cli.com/generators-and-blueprints