storj/web/satellite/tests/unit/mock/api/users.ts
Vitalii Shpital c6c2a1daf9 web/satellite: added MFA login step
Added Enter MFA passcode step to login after first attempt.
Connected client-side and server-side.

Change-Id: I4482afde50172bbf2c598aa01bbd220763b4f6d1
2021-07-30 08:50:19 +00:00

40 lines
950 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { UpdatedUser, User, UsersApi } from '@/types/users';
/**
* Mock for UsersApi
*/
export class UsersApiMock implements UsersApi {
private mockUser: User;
public setMockUser(mockUser: User): void {
this.mockUser = mockUser;
}
public get(): Promise<User> {
return Promise.resolve(this.mockUser);
}
public update(user: UpdatedUser): Promise<void> {
throw new Error('not implemented');
}
public enableUserMFA(_: string): Promise<void> {
return Promise.resolve();
}
public disableUserMFA(_: string): Promise<void> {
return Promise.resolve();
}
public generateUserMFASecret(): Promise<string> {
return Promise.resolve('test');
}
public generateUserMFARecoveryCodes(): Promise<string[]> {
return Promise.resolve(['test', 'test1', 'test2']);
}
}