mirror of
https://github.com/bitwarden/android.git
synced 2025-01-11 18:57:39 +03:00
encode email for token service key
This commit is contained in:
parent
2f0ca6f7c0
commit
ae35bd2047
1 changed files with 4 additions and 2 deletions
|
@ -168,7 +168,8 @@ namespace Bit.App.Services
|
||||||
|
|
||||||
public string GetTwoFactorToken(string email)
|
public string GetTwoFactorToken(string email)
|
||||||
{
|
{
|
||||||
var tokenBytes = _secureStorage.Retrieve(string.Format(TwoFactorTokenKeyFormat, email));
|
var emailEncoded = Convert.ToBase64String(Encoding.UTF8.GetBytes(email));
|
||||||
|
var tokenBytes = _secureStorage.Retrieve(string.Format(TwoFactorTokenKeyFormat, emailEncoded));
|
||||||
if(tokenBytes == null)
|
if(tokenBytes == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -179,7 +180,8 @@ namespace Bit.App.Services
|
||||||
|
|
||||||
public void SetTwoFactorToken(string email, string token)
|
public void SetTwoFactorToken(string email, string token)
|
||||||
{
|
{
|
||||||
var key = string.Format(TwoFactorTokenKeyFormat, email);
|
var emailEncoded = Convert.ToBase64String(Encoding.UTF8.GetBytes(email));
|
||||||
|
var key = string.Format(TwoFactorTokenKeyFormat, emailEncoded);
|
||||||
if(token != null)
|
if(token != null)
|
||||||
{
|
{
|
||||||
var tokenBytes = Encoding.UTF8.GetBytes(token);
|
var tokenBytes = Encoding.UTF8.GetBytes(token);
|
||||||
|
|
Loading…
Reference in a new issue