storj/web/satellite/tests/unit/mock/api/users.ts
Vitalii Shpital 2489b78d22 web/satellite: move user MFA secret generation to server-side
It was decided to move user MFA secret generation to server-side and be fetched by http request

Change-Id: I5e31d35fb78d1d9f3280518fe3eb543bb8ed4377
2021-07-19 13:48:09 +00:00

40 lines
986 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { EnableUserMFARequest, 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(_: EnableUserMFARequest): 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']);
}
}