mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
@@ -16,17 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
|
||||||
|
|
||||||
export class AuthenticationMock extends AlfrescoAuthenticationService {
|
// TODO: should be extending AlfrescoAuthenticationService
|
||||||
|
export class AuthenticationMock /*extends AlfrescoAuthenticationService*/ {
|
||||||
|
|
||||||
constructor(settings: AlfrescoSettingsService = null) {
|
// TODO: real auth service returns Observable<string>
|
||||||
super(settings);
|
login(username: string, password: string): Observable<boolean> {
|
||||||
}
|
|
||||||
|
|
||||||
login(username: string, password: string): Observable<string> {
|
|
||||||
if (username === 'fake-username' && password === 'fake-password') {
|
if (username === 'fake-username' && password === 'fake-password') {
|
||||||
return Observable.of('fake-token');
|
return Observable.of(true);
|
||||||
} else {
|
} else {
|
||||||
return Observable.throw('Fake server error');
|
return Observable.throw('Fake server error');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user