From 7280b3ba682be9cd4732eacd92ee3136c8707b58 Mon Sep 17 00:00:00 2001 From: HadiKhai Date: Mon, 21 Oct 2024 12:14:09 +0300 Subject: [PATCH 1/2] feat: nonce and auth --- README.md | 4 +- apps/vc-api/src/api/auth/auth.controller.ts | 44 ++++-- .../ens-manager/requests/sign-in.request.ts | 1 + .../isubname-records.fetcher.ts | 2 +- .../verify-records/verify-records.service.ts | 2 +- .../justaname-initializer.service.ts | 6 +- .../subname-records.fetcher.ts | 36 ++++- apps/vc-api/src/guards/jwt-nonce.guard.ts | 33 ++++ apps/vc-api/src/guards/session.guard.ts | 12 -- package.json | 1 + yarn.lock | 142 +++++++++++++++++- 11 files changed, 240 insertions(+), 43 deletions(-) create mode 100644 apps/vc-api/src/guards/jwt-nonce.guard.ts delete mode 100644 apps/vc-api/src/guards/session.guard.ts diff --git a/README.md b/README.md index 4d32874..92a3ab2 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,7 @@ The application will be available at http://localhost:3000/verifications/v1. **Response**: ```json -{ - "nonce": "1234567890abcdef" -} +"1234567890abcdef" ``` #### Sign In diff --git a/apps/vc-api/src/api/auth/auth.controller.ts b/apps/vc-api/src/api/auth/auth.controller.ts index aad7b23..080d0e6 100644 --- a/apps/vc-api/src/api/auth/auth.controller.ts +++ b/apps/vc-api/src/api/auth/auth.controller.ts @@ -6,6 +6,7 @@ import moment from 'moment'; import { JwtGuard } from '../../guards/jwt.guard'; import { ENS_MANAGER_SERVICE, IEnsManagerService } from '../../core/applications/ens-manager/iens-manager.service'; import { ChainId } from '../../core/domain/entities/environment'; +import {JwtNonceGuard} from "../../guards/jwt-nonce.guard"; type Siwens = { address: string, ens: string, chainId: ChainId }; @@ -19,28 +20,44 @@ export class AuthController { ) {} @Get('nonce') - async getNonce() { - return this.ensManagerService.generateNonce() + async getNonce( + @Res() res: Response, + @Req() req: Request + ) { + const nonce = this.ensManagerService.generateNonce() + const token = this.jwtService.sign({ nonce }, { + expiresIn: 3600 + }); + res.cookie('justverifiednonce', token, { httpOnly: true, secure: true, sameSite: 'none' }); + res.status(200).send( nonce ); } + @UseGuards(JwtNonceGuard) @Post('signin') async signInChallenge( @Body() body: AuthSigninApiRequest, @Res() res: Response, - @Req() req: Request + @Req() req: Request & { nonce: { nonce: string } } ) { - const { address, ens, chainId } = await this.ensManagerService.signIn({ - message: body.message, - signature: body.signature - }) + res.clearCookie('justverifiednonce', { httpOnly: true, secure: true, sameSite: 'none' }); + try { + const {address, ens, chainId} = await this.ensManagerService.signIn({ + message: body.message, + signature: body.signature, + nonce: req.nonce.nonce, + }) - const token = this.jwtService.sign({ ens, address, chainId }, { - expiresIn: moment().add(1, 'hour').unix() - }); + const token = this.jwtService.sign({ens, address, chainId}, { + expiresIn: 3600 + }); - res.cookie('justverifiedtoken', token, { httpOnly: true, secure: true, sameSite: 'none' }); + res.cookie('justverifiedtoken', token, {httpOnly: true, secure: true, sameSite: 'none'}); - return res.status(200).send({ ens, address, chainId }); + return res.status(200).send({ens, address, chainId}); + }catch (e) { + console.log(e); + res.status(422).send({message: e.message}); + } } @@ -64,7 +81,8 @@ export class AuthController { @Req() req: Request, @Res() res: Response ) { - res.clearCookie('justverifiedtoken'); + res.clearCookie('justverifiedtoken', { httpOnly: true, secure: true, sameSite: 'none' }); + res.clearCookie('justverifiednonce', { httpOnly: true, secure: true, sameSite: 'none' }); res.status(200).send({ message: 'You have been signed out' }); } } diff --git a/apps/vc-api/src/core/applications/ens-manager/requests/sign-in.request.ts b/apps/vc-api/src/core/applications/ens-manager/requests/sign-in.request.ts index 3289b55..2eee5f6 100644 --- a/apps/vc-api/src/core/applications/ens-manager/requests/sign-in.request.ts +++ b/apps/vc-api/src/core/applications/ens-manager/requests/sign-in.request.ts @@ -1,4 +1,5 @@ export class SignInRequest { message: string signature: string + nonce?: string } diff --git a/apps/vc-api/src/core/applications/verify-records/isubname-records.fetcher.ts b/apps/vc-api/src/core/applications/verify-records/isubname-records.fetcher.ts index 4be374f..0ce111d 100644 --- a/apps/vc-api/src/core/applications/verify-records/isubname-records.fetcher.ts +++ b/apps/vc-api/src/core/applications/verify-records/isubname-records.fetcher.ts @@ -3,5 +3,5 @@ import { Subname } from '../../domain/entities/subname'; export const SUBNAME_RECORDS_FETCHER = 'SUBNAME_RECORDS_FETCHER'; export interface ISubnameRecordsFetcher { - fetchRecords(subname: string, chainId: number): Promise; + fetchRecords(subname: string, chainId: number, texts?: string[]): Promise; } diff --git a/apps/vc-api/src/core/applications/verify-records/verify-records.service.ts b/apps/vc-api/src/core/applications/verify-records/verify-records.service.ts index 0ff10f2..b96e6b1 100644 --- a/apps/vc-api/src/core/applications/verify-records/verify-records.service.ts +++ b/apps/vc-api/src/core/applications/verify-records/verify-records.service.ts @@ -38,7 +38,7 @@ export class VerifyRecordsService implements IVerifyRecordsService { throw ChainIdInvalidException.withId(chainId); } - const subnameRecords = await this.subnameRecordsFetcher.fetchRecords(ens, chainId); + const subnameRecords = await this.subnameRecordsFetcher.fetchRecords(ens, chainId, [...credentials, ...credentials.map((record) => `${record}_${validIssuer}`)]); let responses: VerifyRecordsResponse = {} diff --git a/apps/vc-api/src/external/justaname-initializer/justaname-initializer.service.ts b/apps/vc-api/src/external/justaname-initializer/justaname-initializer.service.ts index 2bc2247..00605a8 100644 --- a/apps/vc-api/src/external/justaname-initializer/justaname-initializer.service.ts +++ b/apps/vc-api/src/external/justaname-initializer/justaname-initializer.service.ts @@ -45,9 +45,9 @@ export class JustaNameInitializerService implements IEnsManagerService { try { const sign = await this.justaname.signIn.signIn({ message: params.message, - signature: params.signature - } - ); + signature: params.signature, + nonce: params.nonce + }); return { address: sign.data.address, diff --git a/apps/vc-api/src/external/subname-records-fetcher/subname-records.fetcher.ts b/apps/vc-api/src/external/subname-records-fetcher/subname-records.fetcher.ts index 1ac2864..1e91a5b 100644 --- a/apps/vc-api/src/external/subname-records-fetcher/subname-records.fetcher.ts +++ b/apps/vc-api/src/external/subname-records-fetcher/subname-records.fetcher.ts @@ -5,6 +5,9 @@ import { ENVIRONMENT_GETTER, IEnvironmentGetter } from '../../core/applications/ import { ENS_MANAGER_SERVICE, IEnsManagerService } from '../../core/applications/ens-manager/iens-manager.service'; import { ChainId } from '../../core/domain/entities/environment'; import { GetRecordsResponse } from '../../core/applications/ens-manager/responses/get-records.response'; +import { getRecords } from '@ensdomains/ensjs/public'; +import {createClient, http} from "viem"; +import {mainnet, sepolia} from "viem/chains"; @Injectable() export class SubnameRecordsFetcher implements ISubnameRecordsFetcher { @@ -13,12 +16,35 @@ export class SubnameRecordsFetcher implements ISubnameRecordsFetcher { @Inject(ENS_MANAGER_SERVICE) private readonly ensManagerService: IEnsManagerService ) {} - async fetchRecords(subname: string, chainId: ChainId): Promise { + async fetchRecords(subname: string, chainId: ChainId, texts?: string[]): Promise { - const records = await this.ensManagerService.getRecords({ - ens: subname, - chainId: chainId, - }) + let records: GetRecordsResponse; + const providerUrl = (chainId === 1 ? 'https://mainnet.infura.io/v3/' :'https://sepolia.infura.io/v3/') + this.environmentGetter.getInfuraProjectId() + + if(texts) { + const client = createClient({ + chain: chainId === 1 ? mainnet : sepolia, + transport: http(providerUrl) + }); + + const recordsFromEns = await getRecords(client,{ + name: subname, + texts: texts, + coins: ['eth'], + contentHash: true + }); + + records = { + ...recordsFromEns, + isJAN: false + } + } + else{ + records = await this.ensManagerService.getRecords({ + ens: subname, + chainId: chainId, + }) + } return this.mapSubnameRecordsResponseToSubname(subname, records); } diff --git a/apps/vc-api/src/guards/jwt-nonce.guard.ts b/apps/vc-api/src/guards/jwt-nonce.guard.ts new file mode 100644 index 0000000..2ab901f --- /dev/null +++ b/apps/vc-api/src/guards/jwt-nonce.guard.ts @@ -0,0 +1,33 @@ +import { CanActivate, ExecutionContext, Injectable, UnauthorizedException } from '@nestjs/common'; +import { JwtService } from '@nestjs/jwt'; +import { Reflector } from '@nestjs/core'; +import { Request } from 'express'; + +@Injectable() +export class JwtNonceGuard implements CanActivate { + constructor( + private jwtService: JwtService, + private reflector: Reflector, + ) {} + + async canActivate(context: ExecutionContext): Promise { + const request = context.switchToHttp().getRequest(); + const nonce = this.extractTokenFromHeader(request); + if (!nonce) { + throw new UnauthorizedException(); + } + try { + const payload = await this.jwtService.verifyAsync(nonce, { + secret: process.env.JWT_SECRET, + }); + request['nonce'] = payload; + } catch { + throw new UnauthorizedException(); + } + return true; + } + + private extractTokenFromHeader(request: Request): string | undefined { + return request.headers.cookie?.split(';').find((cookie) => cookie.trim().startsWith('justverifiednonce='))?.split('=')[1]; + } +} diff --git a/apps/vc-api/src/guards/session.guard.ts b/apps/vc-api/src/guards/session.guard.ts deleted file mode 100644 index 2bdcc36..0000000 --- a/apps/vc-api/src/guards/session.guard.ts +++ /dev/null @@ -1,12 +0,0 @@ -// import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'; -// import { Request } from 'express'; -// @Injectable() -// export class SessionGuard implements CanActivate { -// constructor() {} -// canActivate(context: ExecutionContext): boolean { -// const req: Request = context.switchToHttp().getRequest(); //Request Object -// const session = req.session; //Session Object -// -// return !!session.siwj; -// } -// } diff --git a/package.json b/package.json index 490e746..067609d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "license": "MIT", "private": true, "dependencies": { + "@ensdomains/ensjs": "^4.0.1-alpha.0", "@justaname.id/sdk": "0.2.98", "@nestjs/common": "^10.0.2", "@nestjs/config": "^3.2.3", diff --git a/yarn.lock b/yarn.lock index c06ee31..8850eb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1377,6 +1377,57 @@ resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.2.tgz#ff9221b9f58b4dfe61e619a7788734bd63f6898b" integrity sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g== +"@ensdomains/address-encoder@1.0.0-rc.3": + version "1.0.0-rc.3" + resolved "https://registry.yarnpkg.com/@ensdomains/address-encoder/-/address-encoder-1.0.0-rc.3.tgz#78a8081bed834661e7fd21a9c9f67f927100fce5" + integrity sha512-8o6zH69rObIqDY4PusEWuN9jvVOct+9jj9AOPO7ifc3ev8nmsly0e8TE1sHkhk0iKFbd3DlSsUnJ+yuRWmdLCQ== + dependencies: + "@noble/curves" "^1.2.0" + "@noble/hashes" "^1.3.2" + "@scure/base" "^1.1.5" + +"@ensdomains/address-encoder@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@ensdomains/address-encoder/-/address-encoder-1.1.1.tgz#5cbec1fc6e2435b109c058426d7c222cb5a5d8de" + integrity sha512-yg7s+suCuKRhaGsgLu57W/jxIs/Lnqs/SU7jT7UwS4ATSnW94jbUCbmyyZ82CQwKsmwaUE8uYvvVb4N6lfz29A== + dependencies: + "@noble/curves" "^1.2.0" + "@noble/hashes" "^1.3.2" + "@scure/base" "^1.1.5" + +"@ensdomains/content-hash@3.1.0-rc.1": + version "3.1.0-rc.1" + resolved "https://registry.yarnpkg.com/@ensdomains/content-hash/-/content-hash-3.1.0-rc.1.tgz#f22220df19be2f60683070a683f5760a9a7134d8" + integrity sha512-OzdkXgdFmduzcJKU4KRkkJkQHnm5p7m7FkX8k+bHOEoOIzc0ueGT/Jay4nnb60wNk1wSHRmzY+hHBMpFDiGReg== + dependencies: + "@ensdomains/address-encoder" "1.0.0-rc.3" + "@noble/curves" "^1.2.0" + "@scure/base" "^1.1.5" + +"@ensdomains/dnsprovejs@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@ensdomains/dnsprovejs/-/dnsprovejs-0.5.1.tgz#7b09121580d3224736567e680697fe179f0288af" + integrity sha512-nfm4ggpK5YBVwVwLZKF9WPjRGRTL9aUxX2O4pqv/AnQCz3WeGHsW7VhVFLj2s4EoWSzCXwR1E6nuqgUwnH692w== + dependencies: + "@noble/hashes" "^1.3.2" + dns-packet "^5.6.1" + typescript-logging "^1.0.1" + +"@ensdomains/ensjs@^4.0.1-alpha.0": + version "4.0.1-alpha.0" + resolved "https://registry.yarnpkg.com/@ensdomains/ensjs/-/ensjs-4.0.1-alpha.0.tgz#912ec26decc6903d1d101ad06a7a4ebf0d1cccb5" + integrity sha512-IGaxCfvEibLKhPDhEC6zYUnhXgHFalZLsoZq0R58KmuzmJbWkQ1jwzbhVPXBfMYuGwcr4iz/4auiNT0x5aS7Zg== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@ensdomains/address-encoder" "1.1.1" + "@ensdomains/content-hash" "3.1.0-rc.1" + "@ensdomains/dnsprovejs" "^0.5.1" + abitype "^1.0.0" + dns-packet "^5.3.1" + graphql "^16.3.0" + graphql-request "6.1.0" + pako "^2.1.0" + "@esbuild/aix-ppc64@0.21.5": version "0.21.5" resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" @@ -2009,6 +2060,11 @@ resolved "https://registry.yarnpkg.com/@golevelup/ts-jest/-/ts-jest-0.5.6.tgz#e63e3d746417de07cbd5d45208de380cd185346a" integrity sha512-QnxP42Qu9M2UogdrF2kxpZcgWeW9R3WoUr+LdpcsbkvX3LjEoDYgrJ/PnV/QUCbxB1gaKbhR0ZxlDxE1cPkpDg== +"@graphql-typed-document-node/core@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" + integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== + "@hapi/hoek@^9.0.0", "@hapi/hoek@^9.3.0": version "9.3.0" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb" @@ -3261,7 +3317,7 @@ dependencies: "@noble/hashes" "1.4.0" -"@noble/curves@^1.0.0", "@noble/curves@^1.1.0", "@noble/curves@^1.4.0": +"@noble/curves@^1.0.0", "@noble/curves@^1.1.0", "@noble/curves@^1.2.0", "@noble/curves@^1.4.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== @@ -3283,7 +3339,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== -"@noble/hashes@1.5.0", "@noble/hashes@^1.1.2", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.4.0", "@noble/hashes@~1.5.0": +"@noble/hashes@1.5.0", "@noble/hashes@^1.1.2", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.2", "@noble/hashes@^1.4.0", "@noble/hashes@~1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== @@ -4444,7 +4500,7 @@ resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.22.2.tgz#d4ff9972e58f9344fc95f8d41b2ec6517baa8e79" integrity sha512-Y0yAxRaB98LFp2Dm+ACZqBSdAmI3FlpH/LjxOZ94g/ouuDJecSq0iR26XZ5QDuEL8Rf+L4jBJaoDC08CD0KkJw== -"@scure/base@^1.1.3", "@scure/base@~1.1.3", "@scure/base@~1.1.6", "@scure/base@~1.1.8": +"@scure/base@^1.1.3", "@scure/base@^1.1.5", "@scure/base@~1.1.3", "@scure/base@~1.1.6", "@scure/base@~1.1.8": version "1.1.9" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== @@ -7249,6 +7305,11 @@ abitype@1.0.5: resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.5.tgz#29d0daa3eea867ca90f7e4123144c1d1270774b6" integrity sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw== +abitype@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.6.tgz#76410903e1d88e34f1362746e2d407513c38565b" + integrity sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A== + abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -9103,7 +9164,7 @@ cron-parser@^4.2.0: dependencies: luxon "^3.2.1" -cross-fetch@^3.1.4: +cross-fetch@^3.1.4, cross-fetch@^3.1.5: version "3.1.8" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== @@ -9858,7 +9919,7 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -dns-packet@^5.2.2: +dns-packet@^5.2.2, dns-packet@^5.3.1, dns-packet@^5.6.1: version "5.6.1" resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" integrity sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw== @@ -10236,6 +10297,13 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +error-stack-parser@^1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-1.3.6.tgz#e0e73b93e417138d1cd7c0b746b1a4a14854c292" + integrity sha512-xhuSYd8wLgOXwNgjcPeXMPL/IiiA1Huck+OPvClpJViVNNlJVtM41o+1emp7bPvlCJwCatFX2DWc05/DgfbWzA== + dependencies: + stackframe "^0.3.1" + es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23.0, es-abstract@^1.23.2, es-abstract@^1.23.3: version "1.23.3" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.3.tgz#8f0c5a35cd215312573c5a27c87dfd6c881a0aa0" @@ -11803,6 +11871,19 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== +graphql-request@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.1.0.tgz#f4eb2107967af3c7a5907eb3131c671eac89be4f" + integrity sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw== + dependencies: + "@graphql-typed-document-node/core" "^3.2.0" + cross-fetch "^3.1.5" + +graphql@^16.3.0: + version "16.9.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f" + integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw== + h3@^1.10.2, h3@^1.12.0: version "1.12.0" resolved "https://registry.yarnpkg.com/h3/-/h3-1.12.0.tgz#9d7f05f08a997d263e484b02436cb027df3026d8" @@ -15611,6 +15692,11 @@ package-json-from-dist@^1.0.0: resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz#e501cd3094b278495eb4258d4c9f6d5ac3019f00" integrity sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw== +pako@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -17894,6 +17980,11 @@ source-map-support@^0.5.21, source-map-support@~0.5.20: buffer-from "^1.0.0" source-map "^0.6.0" +source-map@0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + integrity sha512-MjZkVp0NHr5+TPihLcadqnlVoGIoWo4IBHptutGh9wI3ttUYvCG26HkSuDi+K6lsZ25syXJXcctwgyVCt//xqA== + source-map@0.7.4, source-map@^0.7.3, source-map@^0.7.4: version "0.7.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" @@ -18000,6 +18091,13 @@ stable@^0.1.8: resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" integrity sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w== +stack-generator@^1.0.7: + version "1.1.0" + resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-1.1.0.tgz#36f6a920751a6c10f499a13c32cbb5f51a0b8b25" + integrity sha512-sZDVjwC56vZoo+a5t0LH/1sMQLWYLi/r+Z2ztyCAOhOX3QBP34GWxK0FWf2eU1TIU2CJKCKBAtDZycUh/ZKMlw== + dependencies: + stackframe "^1.0.2" + stack-utils@^2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" @@ -18012,6 +18110,33 @@ stackback@0.0.2: resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== +stackframe@^0.3.1, stackframe@~0.3: + version "0.3.1" + resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4" + integrity sha512-XmoiF4T5nuWEp2x2w92WdGjdHGY/cZa6LIbRsDRQR/Xlk4uW0PAUlH1zJYVffocwKpCdwyuypIp25xsSXEtZHw== + +stackframe@^1.0.2: + version "1.3.4" + resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.3.4.tgz#b881a004c8c149a5e8efef37d51b16e412943310" + integrity sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw== + +stacktrace-gps@^2.4.3: + version "2.4.4" + resolved "https://registry.yarnpkg.com/stacktrace-gps/-/stacktrace-gps-2.4.4.tgz#69c827e9d6d6f41cf438d7f195e2e3cbfcf28c44" + integrity sha512-msFhuMEEklQLUtaJ+GeCDjzUN+PamfHWQiK3C1LnbHjoxSeF5dAxiE+aJkptNMmMNOropGFJ7G3ZT7dPZHgDaQ== + dependencies: + source-map "0.5.6" + stackframe "~0.3" + +stacktrace-js@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/stacktrace-js/-/stacktrace-js-1.3.1.tgz#67cab2589af5c417b962f7369940277bb3b6a18b" + integrity sha512-b+5voFnXqg9TWdOE50soXL+WuOreYUm1Ukg9U7rzEWGL4+gcVxIcFasNBtOffVX0I1lYqVZj0PZXZvTt5e3YRQ== + dependencies: + error-stack-parser "^1.3.6" + stack-generator "^1.0.7" + stacktrace-gps "^2.4.3" + statuses@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -18949,6 +19074,13 @@ typeorm@^0.3.17: uuid "^9.0.0" yargs "^17.6.2" +typescript-logging@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/typescript-logging/-/typescript-logging-1.0.1.tgz#e0f8157943780cf5943aacd53b04cb73d108a0f9" + integrity sha512-zp28ABme0m5q/nXabBaY9Hv/35N8lMH4FsvhpUO0zVi4vFs3uKlb5br2it61HAZF5k+U0aP6E67j0VD0IzXGpQ== + dependencies: + stacktrace-js "1.3.1" + typescript@5.5.4: version "5.5.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" From 6081027a56de898ab6c49c01ca73add35e94e1ae Mon Sep 17 00:00:00 2001 From: HadiKhai Date: Mon, 21 Oct 2024 13:11:14 +0300 Subject: [PATCH 2/2] fix: remove console.log --- apps/vc-api/src/api/auth/auth.controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/vc-api/src/api/auth/auth.controller.ts b/apps/vc-api/src/api/auth/auth.controller.ts index 080d0e6..adbcba6 100644 --- a/apps/vc-api/src/api/auth/auth.controller.ts +++ b/apps/vc-api/src/api/auth/auth.controller.ts @@ -55,7 +55,6 @@ export class AuthController { return res.status(200).send({ens, address, chainId}); }catch (e) { - console.log(e); res.status(422).send({message: e.message}); }