mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-16 12:38:13 +00:00
updates code formart for login controller
This commit is contained in:
parent
70bf499cc4
commit
ea21f86983
@ -1,12 +1,6 @@
|
|||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
|
||||||
const {
|
const { Controller, computed, get, setProperties, inject: { service } } = Ember;
|
||||||
Controller,
|
|
||||||
computed,
|
|
||||||
get,
|
|
||||||
setProperties,
|
|
||||||
inject: { service }
|
|
||||||
} = Ember;
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
session: service(),
|
session: service(),
|
||||||
@ -22,15 +16,11 @@ export default Controller.extend({
|
|||||||
* Using the session service, authenticate using the custom ldap authenticator
|
* Using the session service, authenticate using the custom ldap authenticator
|
||||||
*/
|
*/
|
||||||
authenticateUser() {
|
authenticateUser() {
|
||||||
const { username, password } = this.getProperties([
|
const { username, password } = this.getProperties(['username', 'password']);
|
||||||
'username',
|
|
||||||
'password'
|
|
||||||
]);
|
|
||||||
|
|
||||||
get(this, 'session')
|
get(this, 'session')
|
||||||
.authenticate('authenticator:custom-ldap', username, password)
|
.authenticate('authenticator:custom-ldap', username, password)
|
||||||
.catch(({ responseText = 'Bad Credentials' }) =>
|
.catch(({ responseText = 'Bad Credentials' }) => setProperties(this, { errorMessage: responseText }));
|
||||||
setProperties(this, { errorMessage: responseText }));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user