mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Fix authentication mock
This commit is contained in:
parent
0895106441
commit
3d748b61b5
@ -16,14 +16,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
|
import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||||
|
|
||||||
// TODO: should be extending AlfrescoAuthenticationService
|
export class AuthenticationMock extends AlfrescoAuthenticationService {
|
||||||
export class AuthenticationMock /*extends AlfrescoAuthenticationService*/ {
|
|
||||||
|
|
||||||
// TODO: real auth service returns Observable<string>
|
constructor(settings: AlfrescoSettingsService = null) {
|
||||||
login(username: string, password: string): Observable<boolean> {
|
super(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
login(username: string, password: string): Observable<string> {
|
||||||
if (username === 'fake-username' && password === 'fake-password') {
|
if (username === 'fake-username' && password === 'fake-password') {
|
||||||
return Observable.of(true);
|
return Observable.of('fake-token');
|
||||||
} else {
|
} else {
|
||||||
return Observable.throw('Fake server error');
|
return Observable.throw('Fake server error');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user