Merge pull request #203 from My1/patch-1
fix issue with other characters in TOTP
This commit is contained in:
Коммит
e873dd9062
|
@ -29,7 +29,7 @@
|
|||
+ ' <img src="{{qr}}">'
|
||||
+ '</div>'
|
||||
+ '<span>' + t('twofactor_totp', 'Once you have configured your app, enter a test code below to ensure that your app has been configured correctly.') + '<span><br>'
|
||||
+ '<input id="totp-confirmation" type="tel" minlength="6" maxlength="6" autocomplete="off" autocapitalize="off" placeholder="' + t('twofactor_totp', 'Authentication code') + '">'
|
||||
+ '<input id="totp-confirmation" type="tel" minlength="6" maxlength="10" autocomplete="off" autocapitalize="off" placeholder="' + t('twofactor_totp', 'Authentication code') + '">'
|
||||
+ '<input id="totp-confirmation-submit" type="button" value="' + t('twofactor_totp', 'Verify') + '">'
|
||||
+ '{{/if}}';
|
||||
|
||||
|
@ -238,4 +238,4 @@
|
|||
|
||||
OC.Settings.TwoFactorTotp.View = View;
|
||||
|
||||
})(OC, OC.Backbone, Handlebars, $, _);
|
||||
})(OC, OC.Backbone, Handlebars, $, _);
|
||||
|
|
|
@ -89,6 +89,7 @@ class TotpProvider implements IProvider {
|
|||
* @param string $challenge
|
||||
*/
|
||||
public function verifyChallenge(IUser $user, $challenge) {
|
||||
$challenge = preg_replace('/[^0-9]/', '', $challenge);
|
||||
return $this->totp->validateSecret($user, $challenge);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ style('twofactor_totp', 'style');
|
|||
?>
|
||||
|
||||
<form method="POST" class="totp-form">
|
||||
<input type="tel" minlength="6" maxlength="6" name="challenge" required="required" autofocus autocomplete="off" autocapitalize="off" placeholder="<?php p($l->t('Authentication code')) ?>">
|
||||
<input type="tel" minlength="6" maxlength="10" name="challenge" required="required" autofocus autocomplete="off" autocapitalize="off" placeholder="<?php p($l->t('Authentication code')) ?>">
|
||||
<button type="submit">
|
||||
<span><?php p($l->t('Submit')); ?></span>
|
||||
</button>
|
||||
|
|
Загрузка…
Ссылка в новой задаче