mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
auth with cas
This commit is contained in:
parent
8c99977fc9
commit
8c2df6178d
150 changed files with 43682 additions and 24175 deletions
|
@ -9,10 +9,13 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import { isPresent } from '@ember/utils';
|
||||
|
||||
import { reject, resolve } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
import Base from 'ember-simple-auth/authenticators/base';
|
||||
import netUtil from "../utils/net";
|
||||
|
||||
export default Base.extend({
|
||||
ajax: service(),
|
||||
|
@ -28,8 +31,16 @@ export default Base.extend({
|
|||
return reject();
|
||||
},
|
||||
|
||||
authenticate(){
|
||||
return this.get('ajax').request('public/authenticate/cas' );
|
||||
authenticate(data){
|
||||
data.domain = netUtil.getSubdomain();
|
||||
|
||||
if (!isPresent(data.ticket)) {
|
||||
return reject("data.ticket is empty");
|
||||
}
|
||||
return this.get('ajax').post('public/authenticate/cas', {
|
||||
data: JSON.stringify(data),
|
||||
contentType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
invalidate() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue