mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-03 12:16:10 +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 { inject as service } from '@ember/service';
|
||||
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';
|
||||
|
||||
const AppRouter = Router.extend({
|
||||
@ -13,9 +13,12 @@ const AppRouter = Router.extend({
|
||||
metrics: service(),
|
||||
|
||||
willTransition() {
|
||||
const { APP: { useSecureRedirect } } = config;
|
||||
this._super(...arguments);
|
||||
|
||||
redirectToHttps(window.location);
|
||||
if (useSecureRedirect) {
|
||||
redirectToHttps(window.location);
|
||||
}
|
||||
},
|
||||
|
||||
didTransition() {
|
||||
|
||||
@ -18,8 +18,7 @@ module.exports = function(environment) {
|
||||
},
|
||||
|
||||
APP: {
|
||||
// Here you can pass flags/options to your application instance
|
||||
// when it is created
|
||||
useSecureRedirect: true
|
||||
},
|
||||
|
||||
eyeglass: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user