mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Improved secure mode viewing
Co-Authored-By: McMatts <matt@documize.com>
This commit is contained in:
parent
ab2cbd4ff7
commit
df0e3c108e
3 changed files with 5 additions and 10 deletions
|
@ -73,6 +73,8 @@ export default Service.extend({
|
||||||
return resolve(this);
|
return resolve(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requestedRoute = requestedRoute.toLowerCase().trim();
|
||||||
|
|
||||||
return this.get('ajax').request('public/meta').then((response) => {
|
return this.get('ajax').request('public/meta').then((response) => {
|
||||||
this.setProperties(response);
|
this.setProperties(response);
|
||||||
this.set('version', 'v' + this.get('version'));
|
this.set('version', 'v' + this.get('version'));
|
||||||
|
@ -86,6 +88,7 @@ export default Service.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
this.get('localStorage').clearAll();
|
this.get('localStorage').clearAll();
|
||||||
|
return resolve(this);
|
||||||
} else if (is.not.include(requestedUrl, '/auth/')) {
|
} else if (is.not.include(requestedUrl, '/auth/')) {
|
||||||
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,6 @@ export default Service.extend({
|
||||||
|
|
||||||
// Run tenant level backup.
|
// Run tenant level backup.
|
||||||
backup(spec) {
|
backup(spec) {
|
||||||
|
|
||||||
return new EmberPromise((resolve) => {
|
return new EmberPromise((resolve) => {
|
||||||
let url = this.get('appMeta.endpoint');
|
let url = this.get('appMeta.endpoint');
|
||||||
let token = this.get('sessionService.session.content.authenticated.token');
|
let token = this.get('sessionService.session.content.authenticated.token');
|
||||||
|
@ -177,12 +176,5 @@ export default Service.extend({
|
||||||
|
|
||||||
xhr.send(JSON.stringify(spec));
|
xhr.send(JSON.stringify(spec));
|
||||||
});
|
});
|
||||||
|
|
||||||
// return this.get('ajax').raw(`global/backup`, {
|
|
||||||
// method: 'post',
|
|
||||||
// data: JSON.stringify(spec),
|
|
||||||
// contentType: 'json',
|
|
||||||
// dataType: 'text'
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default SimpleAuthSession.extend({
|
||||||
}),
|
}),
|
||||||
|
|
||||||
user: computed('isAuthenticated', 'session.content.authenticated.user', function () {
|
user: computed('isAuthenticated', 'session.content.authenticated.user', function () {
|
||||||
if (this.get('isAuthenticated')) {
|
if (this.get('isAuthenticated') && !this.get('appMeta.secureMode')) {
|
||||||
let user = this.get('session.content.authenticated.user') || { id: '0' };
|
let user = this.get('session.content.authenticated.user') || { id: '0' };
|
||||||
let data = this.get('store').normalize('user', user);
|
let data = this.get('store').normalize('user', user);
|
||||||
let um = this.get('store').push(data)
|
let um = this.get('store').push(data)
|
||||||
|
@ -45,7 +45,7 @@ export default SimpleAuthSession.extend({
|
||||||
}),
|
}),
|
||||||
|
|
||||||
authenticated: computed('session.content.authenticated.user', function () {
|
authenticated: computed('session.content.authenticated.user', function () {
|
||||||
if (is.null(this.get('session.authenticator'))) return false;
|
if (is.null(this.get('session.authenticator')) || this.get('appMeta.secureMode')) return false;
|
||||||
return this.get('session.authenticator') !== 'authenticator:anonymous' && this.get('session.content.authenticated.user.id') !== '0';
|
return this.get('session.authenticator') !== 'authenticator:anonymous' && this.get('session.content.authenticated.user.id') !== '0';
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue