mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-13 09:52:46 +00:00
adds cli application configs for secure-redirection
This commit is contained in:
parent
1d6f78d355
commit
872d1cda6d
@ -2,7 +2,7 @@ import Router from '@ember/routing/router';
|
|||||||
import { get, getWithDefault } from '@ember/object';
|
import { get, getWithDefault } from '@ember/object';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import { scheduleOnce } from '@ember/runloop';
|
import { scheduleOnce } from '@ember/runloop';
|
||||||
import config from './config/environment';
|
import config from 'wherehows-web/config/environment';
|
||||||
import { redirectToHttps } from 'wherehows-web/utils/build-url';
|
import { redirectToHttps } from 'wherehows-web/utils/build-url';
|
||||||
|
|
||||||
const AppRouter = Router.extend({
|
const AppRouter = Router.extend({
|
||||||
@ -13,9 +13,12 @@ const AppRouter = Router.extend({
|
|||||||
metrics: service(),
|
metrics: service(),
|
||||||
|
|
||||||
willTransition() {
|
willTransition() {
|
||||||
|
const { APP: { useSecureRedirect } } = config;
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
redirectToHttps(window.location);
|
if (useSecureRedirect) {
|
||||||
|
redirectToHttps(window.location);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
didTransition() {
|
didTransition() {
|
||||||
|
|||||||
@ -18,8 +18,7 @@ module.exports = function(environment) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
APP: {
|
APP: {
|
||||||
// Here you can pass flags/options to your application instance
|
useSecureRedirect: true
|
||||||
// when it is created
|
|
||||||
},
|
},
|
||||||
|
|
||||||
eyeglass: {
|
eyeglass: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user