Trim the entered 2FA token before sending it to the backend #99
This commit is contained in:
parent
41d19c46b4
commit
3de0e3734e
|
@ -122,8 +122,13 @@ private suspend fun internalLogin(
|
||||||
val providerId = json
|
val providerId = json
|
||||||
.encodeToString(providerEntity)
|
.encodeToString(providerEntity)
|
||||||
.removeSurrounding("\"")
|
.removeSurrounding("\"")
|
||||||
|
// None of the 2FA methods should use the leading / trailing
|
||||||
|
// whitespaces, so it's safe to trim them.
|
||||||
|
//
|
||||||
|
// https://github.com/AChep/keyguard-app/issues/99
|
||||||
|
val token = twoFactorToken.token.trim()
|
||||||
append("twoFactorProvider", providerId)
|
append("twoFactorProvider", providerId)
|
||||||
append("twoFactorToken", twoFactorToken.token)
|
append("twoFactorToken", token)
|
||||||
append("twoFactorRemember", twoFactorToken.remember.int.toString())
|
append("twoFactorRemember", twoFactorToken.remember.int.toString())
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue