mirror of
https://github.com/documize/community.git
synced 2025-08-05 13:35:25 +02:00
PRovide LDAP sync and authentication
This commit is contained in:
parent
63b17f9b88
commit
074eea3aeb
38 changed files with 567 additions and 499 deletions
|
@ -20,6 +20,7 @@ export default Service.extend({
|
|||
ajax: service(),
|
||||
localStorage: service(),
|
||||
kcAuth: service(),
|
||||
appHost: '',
|
||||
apiHost: `${config.apiHost}`,
|
||||
endpoint: `${config.apiHost}/${config.apiNamespace}`,
|
||||
conversionEndpoint: '',
|
||||
|
@ -72,6 +73,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request('public/meta').then((response) => {
|
||||
this.setProperties(response);
|
||||
this.set('version', 'v' + this.get('version'));
|
||||
this.set('appHost', window.location.host);
|
||||
|
||||
if (requestedRoute === 'secure') {
|
||||
this.setProperties({
|
||||
|
|
|
@ -96,7 +96,7 @@ export default Service.extend({
|
|||
|
||||
syncLDAP() {
|
||||
if(this.get('sessionService.isAdmin')) {
|
||||
return this.get('ajax').request(`global/sync/ldap`, {
|
||||
return this.get('ajax').request(`global/ldap/sync`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
return response;
|
||||
|
@ -108,7 +108,7 @@ export default Service.extend({
|
|||
|
||||
previewLDAP(config) {
|
||||
if(this.get('sessionService.isAdmin')) {
|
||||
return this.get('ajax').request(`global/sync/ldap/preview`, {
|
||||
return this.get('ajax').request(`global/ldap/preview`, {
|
||||
method: 'POST',
|
||||
data: JSON.stringify(config)
|
||||
}).then((response) => {
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
// https://documize.com
|
||||
|
||||
import { Promise as EmberPromise } from 'rsvp';
|
||||
import Service, { inject as service } from '@ember/service';
|
||||
import netUtil from '../utils/net';
|
||||
import Service, { inject as service } from '@ember/service';
|
||||
|
||||
export default Service.extend({
|
||||
sessionService: service('session'),
|
||||
|
@ -59,7 +59,7 @@ export default Service.extend({
|
|||
return resolve();
|
||||
}).error(() => {
|
||||
return reject(new Error('login failed'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue