Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
chore: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Nov 9, 2023
1 parent 9dbae9c commit 8f8bd1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/api/controllers/ResetDeviceController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
CreateResetDeviceData,
UpdateResetDeviceData
} from "@api/data/ResetDeviceData";
import { ContactMfaType } from "@api/data/ContactData/interface";
import UnauthorizedError from "@api/errors/UnauthorizedError";

@JsonController("/reset-device")
Expand All @@ -33,7 +34,7 @@ export class ResetDeviceController {
async create(@Body() data: CreateResetDeviceData): Promise<void> {
const contact = await ContactsService.findOne({ email: data.email });
if (!contact) {
return
return;
}

// TODO: Check if contact has MFA enabled
Expand Down Expand Up @@ -74,7 +75,9 @@ export class ResetDeviceController {
}

// Disable MFA
await ContactMfaService.delete(rpFlow.contact);
await ContactMfaService.delete(rpFlow.contact, rpFlow.contact.id, {
type: ContactMfaType.TOTP
});

// Stop reset flow
// TODO: ResetPasswordFlow -> ResetSecurityFlow
Expand Down
2 changes: 1 addition & 1 deletion src/core/services/ContactMfaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ContactMfaService {
* Delete contact MFA
*
* ### ATTENTION
* If the id is `'me'` we check if the token is valid, otherwise the user must be an admin, this must be checked before calling this method.
* If the id is `'me'` we check if the token is valid, otherwise the user must be authenticated, this must be checked before calling this method.
* E.g. with the `@TargetUser()` or `@Authorized()` decorators.
*
* @param contact The contact
Expand Down

0 comments on commit 8f8bd1e

Please sign in to comment.