mirror of
https://github.com/documize/community.git
synced 2025-08-04 21:15:24 +02:00
accept shared folder set account to ACTIVE
This commit is contained in:
parent
93ed361705
commit
92eca1a1ce
7 changed files with 641 additions and 621 deletions
|
@ -10,12 +10,9 @@
|
|||
// https://documize.com
|
||||
|
||||
import Ember from 'ember';
|
||||
import encodingUtil from '../../utils/encoding';
|
||||
import netUtil from '../../utils/net';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
folderService: Ember.inject.service('folder'),
|
||||
|
||||
serial: "",
|
||||
folderId: "",
|
||||
slug: "",
|
||||
|
@ -111,10 +108,16 @@ export default Ember.Component.extend({
|
|||
var password = $("#stage-2-password").val();
|
||||
|
||||
self.get('folderService').onboard(self.folderId, payload).then(function(user) {
|
||||
var credentials = encodingUtil.Base64.encode(netUtil.getSubdomain() + ":" + user.email + ":" + password);
|
||||
self.session.sso(credentials).then(function() {
|
||||
let creds = { password: password, email: user.email };
|
||||
|
||||
self.get('session').authenticate('authenticator:documize', creds).then(() => {
|
||||
window.location.href = 's/' + self.folderId + "/" + self.slug;
|
||||
});
|
||||
|
||||
// var credentials = encodingUtil.Base64.encode(netUtil.getSubdomain() + ":" + user.email + ":" + password);
|
||||
// self.session.sso(credentials).then(function() {
|
||||
// window.location.href = 's/' + self.folderId + "/" + self.slug;
|
||||
// });
|
||||
}, function() {
|
||||
window.location.href = "/";
|
||||
});
|
||||
|
|
|
@ -13,6 +13,13 @@ import Ember from 'ember';
|
|||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
session: Ember.inject.service(),
|
||||
localStorage: Ember.inject.service(),
|
||||
|
||||
beforeModel() {
|
||||
this.get('localStorage').clearAll();
|
||||
},
|
||||
|
||||
model: function (params) {
|
||||
this.set('folderId', params.id);
|
||||
this.set('slug', params.slug);
|
||||
|
|
|
@ -13,6 +13,11 @@ import Ember from 'ember';
|
|||
|
||||
export default Ember.Route.extend({
|
||||
session: Ember.inject.service(),
|
||||
localStorage: Ember.inject.service(),
|
||||
|
||||
beforeModel() {
|
||||
this.get('localStorage').clearAll();
|
||||
},
|
||||
|
||||
model({ token }) {
|
||||
this.get("session").authenticate('authenticator:documize', decodeURIComponent(token))
|
||||
|
|
|
@ -77,7 +77,11 @@ export default Ember.Service.extend({
|
|||
|
||||
return this.get('ajax').request('public/meta').then((response) => {
|
||||
this.setProperties(response);
|
||||
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
||||
|
||||
if (is.not.include(requestedUrl, '/auth/')) {
|
||||
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
||||
}
|
||||
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue