22e88c8f0a
Added disable user MFA functionality to account settings. Disable MFA popup where user will have to enter MFA passcode first. 2 buttons (enable, disable)) are visible for now until backend is ready. Change-Id: Iff8b497a370fc1c6c08c5ccaf01ce1f2dc317126
36 lines
885 B
TypeScript
36 lines
885 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 generateUserMFARecoveryCodes(): Promise<string[]> {
|
|
return Promise.resolve(['test', 'test1', 'test2']);
|
|
}
|
|
}
|