From 2d306949b55f272504e745c167a2f46ccf72dbcb Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 21 Aug 2021 15:38:43 +0100 Subject: [PATCH] Cleaned some unused elements during testing --- app/Auth/Access/Mfa/BackupCodeService.php | 10 ++-------- app/Auth/Access/Mfa/MfaValue.php | 11 ----------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/app/Auth/Access/Mfa/BackupCodeService.php b/app/Auth/Access/Mfa/BackupCodeService.php index 6fbbf64b5..ca58e7404 100644 --- a/app/Auth/Access/Mfa/BackupCodeService.php +++ b/app/Auth/Access/Mfa/BackupCodeService.php @@ -34,20 +34,14 @@ class BackupCodeService /** * Remove the given input code from the given available options. - * Will return null if no codes remain otherwise will be a JSON string to contain - * the codes. + * Will return a JSON string containing the codes. */ - public function removeInputCodeFromSet(string $code, string $codeSet): ?string + public function removeInputCodeFromSet(string $code, string $codeSet): string { $cleanCode = $this->cleanInputCode($code); $codes = json_decode($codeSet); $pos = array_search($cleanCode, $codes, true); array_splice($codes, $pos, 1); - - if (count($codes) === 0) { - return null; - } - return json_encode($codes); } diff --git a/app/Auth/Access/Mfa/MfaValue.php b/app/Auth/Access/Mfa/MfaValue.php index 228a6d43f..ec0d5d563 100644 --- a/app/Auth/Access/Mfa/MfaValue.php +++ b/app/Auth/Access/Mfa/MfaValue.php @@ -58,17 +58,6 @@ class MfaValue extends Model return $mfaVal ? $mfaVal->getValue() : null; } - /** - * Delete any stored MFA values for the given user and method. - */ - public static function deleteValuesForUser(User $user, string $method): void - { - static::query() - ->where('user_id', '=', $user->id) - ->where('method', '=', $method) - ->delete(); - } - /** * Decrypt the value attribute upon access. */