Fix two-factor token creation for iOS devices, closes #1624

This commit is contained in:
Dane Everitt 2019-08-03 12:37:02 -07:00
parent 02ac308042
commit 47c12929c4
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
3 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ value when showing an error state.
* Scrolling on email settings page now works. * 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 * 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. 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 ### Added
* Server listing view now displays the total used disk space for each server. * Server listing view now displays the total used disk space for each server.

View File

@ -71,7 +71,7 @@ class TwoFactorSetupService
'totp_secret' => $this->encrypter->encrypt($secret), 'totp_secret' => $this->encrypter->encrypt($secret),
]); ]);
$company = $this->config->get('app.name'); $company = preg_replace('/\s/', '', $this->config->get('app.name'));
return sprintf( return sprintf(
'otpauth://totp/%1$s:%2$s?secret=%3$s&issuer=%1$s', 'otpauth://totp/%1$s:%2$s?secret=%3$s&issuer=%1$s',

View File

@ -60,7 +60,7 @@ class TwoFactorSetupServiceTest extends TestCase
$response = $this->getService()->handle($model); $response = $this->getService()->handle($model);
$this->assertNotEmpty($response); $this->assertNotEmpty($response);
$companyName = preg_quote(rawurlencode('Company Name')); $companyName = preg_quote(rawurlencode('CompanyName'));
$email = preg_quote(rawurlencode($model->email)); $email = preg_quote(rawurlencode($model->email));
$this->assertRegExp( $this->assertRegExp(