mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 16:53:26 +00:00
[PM-3726] prevent legacy user login (#2769)
* [PM-3726] prevent legacy user login * [PM-3726] prevent unlock or auto key migration if legacy user * [PM-3726] add legacy checks to lock page and refactor * [PM-3726] rethrow exception from pin * formatting * [PM-3726] add changes to LockViewController, consolidate logout calls * formatting * [PM-3726] pr feedback * generate resx * formatting
This commit is contained in:
@@ -477,6 +477,17 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
var tokenResponse = response.TokenResponse;
|
||||
if (localHashedPassword != null && tokenResponse.Key == null)
|
||||
{
|
||||
// Only check for legacy if there is no key on token
|
||||
if (await _cryptoService.IsLegacyUserAsync(masterKey))
|
||||
{
|
||||
// Legacy users must migrate on web vault;
|
||||
result.RequiresEncryptionKeyMigration = true;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
result.ResetMasterPassword = tokenResponse.ResetMasterPassword;
|
||||
result.ForcePasswordReset = tokenResponse.ForcePasswordReset;
|
||||
_masterPasswordPolicy = tokenResponse.MasterPasswordPolicy;
|
||||
|
||||
Reference in New Issue
Block a user