mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 13:03:16 +00:00
commit
103129099b
2 changed files with 20 additions and 20 deletions
|
@ -13,6 +13,7 @@
|
||||||
- Fix remote profile avatar urls when storing locally ([b0422d4f](https://github.com/pixelfed/pixelfed/commit/b0422d4f))
|
- Fix remote profile avatar urls when storing locally ([b0422d4f](https://github.com/pixelfed/pixelfed/commit/b0422d4f))
|
||||||
- Enable network timeline caching by default ([c990ac2a](https://github.com/pixelfed/pixelfed/commit/c990ac2a))
|
- Enable network timeline caching by default ([c990ac2a](https://github.com/pixelfed/pixelfed/commit/c990ac2a))
|
||||||
- Redirect /home to / ([97032997](https://github.com/pixelfed/pixelfed/commit/97032997))
|
- Redirect /home to / ([97032997](https://github.com/pixelfed/pixelfed/commit/97032997))
|
||||||
|
- Fix 2FA backup code bug ([a231b3c5](https://github.com/pixelfed/pixelfed/commit/a231b3c5))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)
|
||||||
|
|
|
@ -513,26 +513,25 @@ class AccountController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function twoFactorBackupCheck($request, $code, User $user)
|
protected function twoFactorBackupCheck($request, $code, User $user)
|
||||||
{
|
{
|
||||||
$backupCodes = $user->{'2fa_backup_codes'};
|
$backupCodes = $user->{'2fa_backup_codes'};
|
||||||
if($backupCodes) {
|
if($backupCodes) {
|
||||||
$codes = json_decode($backupCodes, true);
|
$codes = json_decode($backupCodes, true);
|
||||||
foreach ($codes as $c) {
|
foreach ($codes as $c) {
|
||||||
if(hash_equals($c, $code)) {
|
if(hash_equals($c, $code)) {
|
||||||
$codes = array_flatten(array_diff($codes, [$code]));
|
$codes = array_flatten(array_diff($codes, [$code]));
|
||||||
$user->{'2fa_backup_codes'} = json_encode($codes);
|
$user->{'2fa_backup_codes'} = json_encode($codes);
|
||||||
$user->save();
|
$user->save();
|
||||||
$request->session()->push('2fa.session.active', true);
|
$request->session()->push('2fa.session.active', true);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
return false;
|
}
|
||||||
}
|
return false;
|
||||||
}
|
} else {
|
||||||
} else {
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function accountRestored(Request $request)
|
public function accountRestored(Request $request)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue