diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f54d40c..52d63e614 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ value when showing an error state. * Scrolling on email settings page now works. * Database host management will now properly display an error message to the user when there is any type of MySQL related error encountered during creation or update. +* Two-factor tokens generated when a company name has a space in it will now properly be parsed on iOS authenticator devices. ### Added * Server listing view now displays the total used disk space for each server. diff --git a/app/Services/Users/TwoFactorSetupService.php b/app/Services/Users/TwoFactorSetupService.php index 7afb5f2bc..4f2389b18 100644 --- a/app/Services/Users/TwoFactorSetupService.php +++ b/app/Services/Users/TwoFactorSetupService.php @@ -71,7 +71,7 @@ class TwoFactorSetupService 'totp_secret' => $this->encrypter->encrypt($secret), ]); - $company = $this->config->get('app.name'); + $company = preg_replace('/\s/', '', $this->config->get('app.name')); return sprintf( 'otpauth://totp/%1$s:%2$s?secret=%3$s&issuer=%1$s', diff --git a/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php b/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php index 2701071a7..bb753e261 100644 --- a/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php +++ b/tests/Unit/Services/Users/TwoFactorSetupServiceTest.php @@ -60,7 +60,7 @@ class TwoFactorSetupServiceTest extends TestCase $response = $this->getService()->handle($model); $this->assertNotEmpty($response); - $companyName = preg_quote(rawurlencode('Company Name')); + $companyName = preg_quote(rawurlencode('CompanyName')); $email = preg_quote(rawurlencode($model->email)); $this->assertRegExp(