Check if the otpValue is valid without space

Some website (google) give you the key separated with spaces
This commit is contained in:
Hugues Morisset 2016-08-28 12:09:00 +02:00
parent 44eab6c313
commit b7a89bdf47
No known key found for this signature in database
GPG Key ID: 6D60492F33060B4B
1 changed files with 3 additions and 0 deletions

View File

@ -506,6 +506,9 @@ var EntryModel = Backbone.Model.extend({
}
if (Otp.isSecret(otpUrl)) {
otpUrl = Otp.makeUrl(otpUrl.toUpperCase());
} else if (Otp.isSecret(otpUrl.replace(/\s/g, ''))) {
// With space format
otpUrl = Otp.makeUrl(otpUrl.replace(/\s/g, '').toUpperCase());
} else if (otpUrl.toLowerCase().lastIndexOf('otpauth:', 0) !== 0) {
// KeeOTP plugin format
var args = {};