Skip to content

Commit

Permalink
Merge pull request #607 from credebl/agent-token-encryption
Browse files Browse the repository at this point in the history
Added the logs and env config on the common service
  • Loading branch information
KulkarniShashank authored Mar 21, 2024
2 parents 48fce00 + cb57d11 commit c1b7a54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libs/common/src/common.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
import { CommonConstants } from './common.constant';
import { HttpService } from '@nestjs/axios/dist';
import { ResponseService } from '@credebl/response';
import * as dotenv from 'dotenv';
dotenv.config();

@Injectable()
export class CommonService {
Expand Down Expand Up @@ -370,7 +372,11 @@ export class CommonService {
encryptedPassword,
process.env.CRYPTO_PRIVATE_KEY
);

this.logger.debug(`encryptedPassword ::: ${encryptedPassword}`);
this.logger.debug(`process.env.CRYPTO_PRIVATE_KEY ::: ${process.env.CRYPTO_PRIVATE_KEY}`);
const decryptedPassword = JSON.parse(password.toString(CryptoJS.enc.Utf8));
this.logger.debug(`decryptedPassword ::: ${decryptedPassword}`);
return decryptedPassword;
} catch (error) {
throw new BadRequestException('Invalid Credentials');
Expand Down

0 comments on commit c1b7a54

Please sign in to comment.