PM-7392 - TokenSvc - update to use EncString instead of EncryptSvc + fix tests.
This commit is contained in:
parent
38856083ac
commit
c2295e25ab
|
@ -528,8 +528,6 @@ describe("TokenService", () => {
|
|||
|
||||
// No access token key set
|
||||
|
||||
encryptService.stringIsEncString.mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
const result = await tokenService.getAccessToken(userIdFromAccessToken);
|
||||
|
||||
|
@ -564,8 +562,6 @@ describe("TokenService", () => {
|
|||
const secureStorageError = "Secure storage error";
|
||||
secureStorageService.get.mockRejectedValue(new Error(secureStorageError));
|
||||
|
||||
encryptService.stringIsEncString.mockReturnValue(true);
|
||||
|
||||
// Act
|
||||
const result = await tokenService.getAccessToken(userIdFromAccessToken);
|
||||
|
||||
|
|
|
@ -413,7 +413,7 @@ export class TokenService implements TokenServiceAbstraction {
|
|||
try {
|
||||
accessTokenKey = await this.getAccessTokenKey(userId);
|
||||
} catch (error) {
|
||||
if (this.encryptService.stringIsEncString(accessTokenDisk)) {
|
||||
if (EncString.isSerializedEncString(accessTokenDisk)) {
|
||||
this.logService.error(
|
||||
"Access token key retrieval failed. Unable to decrypt encrypted access token. Logging user out.",
|
||||
error,
|
||||
|
@ -437,7 +437,7 @@ export class TokenService implements TokenServiceAbstraction {
|
|||
// accessTokenKey = null;
|
||||
|
||||
if (!accessTokenKey) {
|
||||
if (this.encryptService.stringIsEncString(accessTokenDisk)) {
|
||||
if (EncString.isSerializedEncString(accessTokenDisk)) {
|
||||
// The access token is encrypted but we don't have the key to decrypt it for
|
||||
// whatever reason so we have to log the user out.
|
||||
this.logService.error(
|
||||
|
|
Loading…
Reference in New Issue