Generate recovery tokens when enabling 2FA on an account
This commit is contained in:
parent
7ee509d8c2
commit
a998b463e3
6 changed files with 145 additions and 8 deletions
|
@ -96,9 +96,14 @@ class TwoFactorController extends ClientApiController
|
|||
throw new ValidationException($validator);
|
||||
}
|
||||
|
||||
$this->toggleTwoFactorService->handle($request->user(), $request->input('code'), true);
|
||||
$tokens = $this->toggleTwoFactorService->handle($request->user(), $request->input('code'), true);
|
||||
|
||||
return new JsonResponse([], Response::HTTP_NO_CONTENT);
|
||||
return new JsonResponse([
|
||||
'object' => 'recovery_tokens',
|
||||
'attributes' => [
|
||||
'tokens' => $tokens,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue