1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-10 05:13:31 +00:00

support otpath:// totp secrets

This commit is contained in:
Kyle Spearrin
2018-07-31 12:34:07 -04:00
parent 4e4b56d7fe
commit acdfce7e88
5 changed files with 111 additions and 16 deletions

View File

@@ -178,8 +178,18 @@ namespace Bit.App.Models.Page
public bool LoginTotpLow => LoginTotpSecond <= 7;
public Color LoginTotpColor => !string.IsNullOrWhiteSpace(LoginTotpCode) && LoginTotpLow ?
Color.Red : Color.Black;
public string LoginTotpCodeFormatted => !string.IsNullOrWhiteSpace(LoginTotpCode) ?
string.Format("{0} {1}", LoginTotpCode.Substring(0, 3), LoginTotpCode.Substring(3)) : null;
public string LoginTotpCodeFormatted
{
get
{
if(string.IsNullOrWhiteSpace(LoginTotpCode) || LoginTotpCode.Length < 5)
{
return LoginTotpCode;
}
var half = (int)Math.Floor((double)LoginTotpCode.Length / 2);
return string.Format("{0} {1}", LoginTotpCode.Substring(0, half), LoginTotpCode.Substring(half));
}
}
// Card
public string CardName