mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
set defaults for request context
This commit is contained in:
parent
63b24aed3f
commit
8081b60146
23 changed files with 692 additions and 666 deletions
|
@ -16,6 +16,10 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
folderService: Ember.inject.service('folder'),
|
||||
|
||||
model() {
|
||||
// if (this.get('appMeta.setupMode')) {
|
||||
// localStorage.clearAll();
|
||||
// return;
|
||||
// }
|
||||
return this.get('folderService').getAll();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
import Ember from 'ember';
|
||||
import NotifierMixin from "../../mixins/notifier";
|
||||
import Encoding from "../../utils/encoding";
|
||||
import netUtil from '../../utils/net';
|
||||
|
||||
export default Ember.Controller.extend(NotifierMixin, {
|
||||
|
||||
|
@ -24,7 +25,8 @@ export default Ember.Controller.extend(NotifierMixin, {
|
|||
data: this.model,
|
||||
dataType: "text",
|
||||
}).then(() => {
|
||||
var credentials = Encoding.Base64.encode(":" + this.model.email + ":" + this.model.password);
|
||||
let dom = netUtil.getSubdomain();
|
||||
var credentials = Encoding.Base64.encode(dom + ":" + this.model.email + ":" + this.model.password);
|
||||
window.location.href = "/auth/sso/" + encodeURIComponent(credentials);
|
||||
}).catch((error) => { // eslint-disable-line no-unused-vars
|
||||
// TODO notify user of the error within the GUI
|
||||
|
|
|
@ -33,6 +33,8 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
|||
if (sa !== "authenticator:documize" && sa !== "authenticator:keycloak" && data.allowAnonymousAccess) {
|
||||
if (!this.get('appMeta.setupMode')) {
|
||||
return this.get('session').authenticate('authenticator:anonymous', data);
|
||||
// } else {
|
||||
// this.get('localStorage').clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +44,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
|||
|
||||
sessionAuthenticated() {
|
||||
if (this.get('appMeta.setupMode')) {
|
||||
this.get('localStorage').clearAll();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -68,7 +71,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
|||
console.log(transition); // eslint-disable-line no-console
|
||||
|
||||
if (netUtil.isAjaxAccessError(error) && !this.get('appMeta.setupMode')) {
|
||||
localStorage.clear();
|
||||
localStorage.clearAll();
|
||||
return this.transitionTo('auth.login');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue