mirror of
https://github.com/bitwarden/mobile
synced 2025-02-01 02:57:17 +01:00
encode email for token service key
This commit is contained in:
parent
2f0ca6f7c0
commit
ae35bd2047
@ -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…
x
Reference in New Issue
Block a user