PM-7392 - TokenSvc - update to use EncString instead of EncryptSvc + fix tests.

This commit is contained in:
Jared Snider 2024-05-03 14:26:59 -04:00
parent 38856083ac
commit c2295e25ab
No known key found for this signature in database
GPG Key ID: A149DDD612516286
2 changed files with 2 additions and 6 deletions

View File

@ -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);

View File

@ -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(