mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
working on forentend
This commit is contained in:
parent
9d6b6fec23
commit
8c99977fc9
10 changed files with 130 additions and 5 deletions
|
@ -12,10 +12,12 @@
|
|||
import { inject as service } from '@ember/service';
|
||||
import AuthProvider from '../../../mixins/auth';
|
||||
import Controller from '@ember/controller';
|
||||
import {Promise as EmberPromise} from "rsvp";
|
||||
|
||||
export default Controller.extend(AuthProvider, {
|
||||
appMeta: service('app-meta'),
|
||||
session: service('session'),
|
||||
|
||||
invalidCredentials: false,
|
||||
|
||||
reset() {
|
||||
|
@ -26,7 +28,7 @@ export default Controller.extend(AuthProvider, {
|
|||
});
|
||||
}
|
||||
|
||||
if (this.get('isAuthProviderLDAP')) {
|
||||
if (this.get('isAuthProviderLDAP') || this.get('isAuthProviderCAS')) {
|
||||
this.setProperties({
|
||||
username: '',
|
||||
password: ''
|
||||
|
@ -62,6 +64,24 @@ export default Controller.extend(AuthProvider, {
|
|||
this.set('invalidCredentials', true);
|
||||
});
|
||||
}
|
||||
// if (this.get('isAuthProviderCAS')) {
|
||||
//
|
||||
// this.get('session').authenticate('authenticator:cas').then((response) => {
|
||||
// this.transitionToRoute('folders');
|
||||
// return response;
|
||||
// }).catch(() => {
|
||||
// this.set('invalidCredentials', true);
|
||||
// });
|
||||
// }
|
||||
},
|
||||
loginWithCAS(){
|
||||
// let config = this.get('config');
|
||||
let url = 'https://sso.bangdao-tech.com/sso/login?service=' + encodeURIComponent('https://duty.bangdao-tech.com/');
|
||||
window.location.replace(url);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue