1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 07:43:37 +00:00

Lock by master password page.

This commit is contained in:
Kyle Spearrin
2016-07-18 19:16:27 -04:00
parent 83f4513604
commit d82c0d7d71
7 changed files with 155 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ namespace Bit.App.Services
public class AuthService : IAuthService
{
private const string TokenKey = "token";
private const string EmailKey = "email";
private const string UserIdKey = "userId";
private const string PinKey = "pin";
@@ -19,6 +20,7 @@ namespace Bit.App.Services
private readonly IAuthApiRepository _authApiRepository;
private string _token;
private string _email;
private string _userId;
private string _pin;
@@ -95,6 +97,33 @@ namespace Bit.App.Services
}
}
public string Email
{
get
{
if(_email != null)
{
return _email;
}
_email = _settings.GetValueOrDefault<string>(EmailKey);
return _email;
}
set
{
if(value != null)
{
_settings.AddOrUpdateValue(EmailKey, value);
}
else
{
_settings.Remove(EmailKey);
}
_email = value;
}
}
public bool IsAuthenticated
{
get
@@ -141,6 +170,7 @@ namespace Bit.App.Services
{
Token = null;
UserId = null;
Email = null;
_cryptoService.Key = null;
}