mirror of
https://github.com/documize/community.git
synced 2025-08-09 07:25:23 +02:00
Update application.js
This commit is contained in:
parent
7e31b459b3
commit
86aaead1ce
1 changed files with 9 additions and 3 deletions
|
@ -12,9 +12,15 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import netUtil from '../utils/net';
|
import netUtil from '../utils/net';
|
||||||
|
|
||||||
|
const {
|
||||||
|
inject: { service }
|
||||||
|
} = Ember;
|
||||||
|
|
||||||
export default Ember.Route.extend({
|
export default Ember.Route.extend({
|
||||||
userService: Ember.inject.service('user'),
|
userService: service('user'),
|
||||||
sessionService: Ember.inject.service('session'),
|
sessionService: service('session'),
|
||||||
|
appMeta: service(),
|
||||||
|
|
||||||
transitioning: false,
|
transitioning: false,
|
||||||
|
|
||||||
beforeModel: function(transition) {
|
beforeModel: function(transition) {
|
||||||
|
@ -22,7 +28,7 @@ export default Ember.Route.extend({
|
||||||
let session = this.get('sessionService');
|
let session = this.get('sessionService');
|
||||||
|
|
||||||
// Session ready?
|
// Session ready?
|
||||||
return session.boot().then(function() {
|
return this.get('appMeta').boot().then(function() {
|
||||||
// Need to authenticate?
|
// Need to authenticate?
|
||||||
if (!session.get("appMeta.allowAnonymousAccess") && !session.get("authenticated") &&
|
if (!session.get("appMeta.allowAnonymousAccess") && !session.get("authenticated") &&
|
||||||
is.not.startWith(transition.targetName, 'auth.')) {
|
is.not.startWith(transition.targetName, 'auth.')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue