@ambushsoftworks/nestjs-auth-graphql 0.9.0-rc.2 → 0.9.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -34,6 +34,9 @@ down to what the package actually fires, a fix making
34
34
  `verificationMode: 'token'` functional for the first time, and enforcement of
35
35
  account status — which had never been checked at all. See **Security** first.
36
36
 
37
+ Alongside them, `bcrypt` moves from 5 to 6, taking `tar@6.2.1` and its
38
+ advisories out of consumers' production dependency trees. No hash migration.
39
+
37
40
  > Published as a release candidate under the `next` dist-tag first, so the
38
41
  > verification and password-reset emails could be confirmed through a real
39
42
  > mail client before reaching `latest`. That last hop — a mail client
@@ -41,9 +44,10 @@ account status — which had never been checked at all. See **Security** first.
41
44
  > thing no test suite in this repo can exercise. Install the candidate with
42
45
  > `npm install @ambushsoftworks/nestjs-auth-graphql@next`.
43
46
  >
44
- > **`0.9.0-rc.2` supersedes `rc.1`.** `rc.1` predates the account-status fix
45
- > in **Security** below and still has the suspension window open — test
46
- > against `rc.2`, not `rc.1`.
47
+ > **Test against `0.9.0-rc.3`.** It is `rc.2` plus the move to bcrypt 6 in
48
+ > **Security** below and its documentation — nothing else in the published
49
+ > package changed. `rc.1` predates the account-status fix in the same section
50
+ > and still has the suspension window open.
47
51
 
48
52
  ### ⚠ External configuration required
49
53
  - **`verificationMode: 'token'` requires your frontend to serve two routes.**
@@ -101,6 +105,34 @@ account status — which had never been checked at all. See **Security** first.
101
105
  still exists" — and now states the consequence. No behavioral change to that
102
106
  mode in this release.
103
107
 
108
+ - **`bcrypt` 5.1.1 → 6.0.0: `tar@6.2.1` is no longer in your production dependencies.**
109
+ `bcrypt@5` installed its native binary through `@mapbox/node-pre-gyp@1.0.11`,
110
+ which depends on `tar@6.2.1` — 1 critical and 8 high advisories (path
111
+ traversal, file overwrite, denial of service). All three were the last release
112
+ of their major, so nothing on the bcrypt 5 line fixes it, and consumers could
113
+ not fix it either: this package declared `bcrypt ^5.1.1`, so upgrading your
114
+ own `bcrypt` only nested a second copy. `bcrypt@6` ships prebuilt binaries
115
+ loaded by `node-gyp-build`; its dependency tree is two packages and audits
116
+ clean. Reported by Lift, whose production-dependency audit gate flagged this
117
+ package as high.
118
+
119
+ **The exposure was at install time, not on the request path.** `tar` ran
120
+ while installing bcrypt, to unpack the downloaded binary; at runtime
121
+ `node-pre-gyp` loads and `tar` does not. The advisories still failed
122
+ `npm audit --omit=dev`, which is how consumers gate a release.
123
+
124
+ **No hash migration, in either direction.** Hashes written by bcrypt 5 verify
125
+ under 6 and the reverse, so existing users sign in unchanged and rolling back
126
+ to 0.8.0 does not lock out anyone who set a password on 0.9.0. Checked across
127
+ `$2a$` and `$2b$`, costs 10 and 12, unicode, and passwords past bcrypt's
128
+ 72-byte limit, on Node 22 (glibc) and `node:20-alpine` (musl, no compiler
129
+ toolchain). `auth.service.password-hash-compat.spec.ts` pins it: it signs in
130
+ and changes passwords against hashes generated by bcrypt 5.1.1, which the
131
+ suite never regenerates.
132
+
133
+ **If your app also depends on `bcrypt` directly, move it to `^6.0.0`** in the
134
+ same deploy. Otherwise your own bcrypt 5 keeps `tar` in the tree.
135
+
104
136
  ### Added
105
137
  - **`isUserActive?: (user: IAuthUser) => boolean` module option.** Overrides the
106
138
  default account-active predicate for consumers whose status vocabulary differs
@@ -163,9 +195,10 @@ account status — which had never been checked at all. See **Security** first.
163
195
  - **Base URL resolution consolidated on `verification.baseUrl`.** `AuthService` no longer reads `process.env.FRONTEND_URL` directly. In code mode the legacy env var is still honored as a fallback (deprecated, logged once); in token mode `verification.baseUrl` is required and the env fallback is deliberately not consulted.
164
196
  - Default renderer copy is now mode-aware — a token-mode verification email no longer instructs the reader to "enter the code below" when the email contains no code.
165
197
  - `PASSWORD_RESET_COMPLETED` security-event metadata now reports the real `method` (`'code'` or `'token'`) instead of a hardcoded `'code'`.
198
+ - **`engines.node` is now declared as `>=18`**, which bcrypt 6 requires. This declares the floor rather than raising it: `google-auth-library@10`, a dependency since 0.1.3, already required Node 18, so no install that worked before is excluded. npm warns on an older Node rather than refusing.
166
199
 
167
200
  ### Breaking
168
- - **`IEmailService` — four notification methods removed.** The package never fired these on its own; they were interface surface consumers had to implement for no benefit. Notification beyond verification, password-reset, and password-changed is now consumer-owned via lifecycle hooks. Only affects consumers who implement `IEmailService` **directly** — the bundled `ConfigurableEmailService`, `SendGridEmailService`, and `NoOpEmailService` are updated, so `emailServiceInstance` / `email` users need no action.
201
+ - **`IEmailService` — four notification methods removed.** The package never fired these on its own; they were interface surface consumers had to implement for no benefit. Notification beyond verification, password-reset, and password-changed is now consumer-owned via lifecycle hooks. Only affects consumers who implement `IEmailService` **directly** — the bundled `ConfigurableEmailService`, `SendGridEmailService`, and `NoOpEmailService` are updated, so `emailServiceInstance` / `email` users need no action. **If you did implement them, those emails were never sent** — the package had no call site for any of the four, so an implementation that looked wired up was dead code, and moving it onto the hooks below is the first time it will run. Raised by Lift.
169
202
  - `sendAccountLockedEmail` → wire from the new `onAccountLocked` hook
170
203
  - `sendWelcomeEmail` → wire from `onSignup` (or `onEmailVerified`)
171
204
  - `sendAccountLinkedEmail` → wire from `onOAuthAccountLinked`
@@ -175,6 +208,8 @@ account status — which had never been checked at all. See **Security** first.
175
208
 
176
209
  ### Documentation
177
210
  - **`IBruteForceRepository.deleteOlderThan` contract clarified.** Documented explicitly that it is a retention operation ("prune whatever attempt history you keep, if any"), not a guarantee the caller can rely on, and that **a no-op returning `0` is a valid implementation** for schemas keeping no attempt history — e.g. `failedLoginAttempts` / `lockedUntil` as columns on the user row, overwritten in place. Raised as a question by the Ariadne team, whose schema is exactly that shape.
211
+ - README: the `deleteOlderThan` Prisma example no longer uses `createdAt`, and says to substitute whichever column records when an attempt happened. The name is schema-specific, and a copied name that happens to exist in your schema with a different meaning compiles and prunes the wrong rows. Raised by Lift, whose column is `attemptedAt`.
212
+ - README: **Installation** states the Node.js 18 floor and the platforms bcrypt ships prebuilt binaries for; **Migrating to v0.9.0** covers the bcrypt move.
178
213
  - README: the two verification modes differ in **where the secret lives**, not merely in formatting — token mode puts the credential in the link, code mode keeps it in the body so it never reaches browser history, referrer headers, or proxy logs.
179
214
  - README: new "Migrating to v0.9.0" section covering both workstreams — the removed interface methods with their hook-based replacements, and the action-required items for token-mode consumers (`verification.baseUrl` now required at boot; `resetPassword`/`verifyEmail` now receive a 128-character token, so input DTO constraints sized for 6-digit codes must be relaxed).
180
215
  - README: "Verification Modes" section rewritten with a code-vs-token comparison table, the exact link format the package emits, base-URL resolution order, and guidance for custom `IEmailService` implementations.
package/README.md CHANGED
@@ -54,6 +54,8 @@ Production-grade authentication module for NestJS GraphQL + REST APIs. JWT, cook
54
54
  npm install @ambushsoftworks/nestjs-auth-graphql
55
55
  ```
56
56
 
57
+ Requires **Node.js 18 or later**. Passwords are hashed with the native `bcrypt` module, which ships prebuilt binaries for Linux (glibc and musl/Alpine; x64, arm64, arm), macOS, and Windows, so installing on those platforms needs no compiler toolchain.
58
+
57
59
  ### Peer Dependencies
58
60
 
59
61
  ```bash
@@ -765,7 +767,7 @@ export class BruteForceCleanupJob {
765
767
  }
766
768
  ```
767
769
 
768
- This requires `IBruteForceRepository.deleteOlderThan(beforeDate: Date): Promise<number>` on your repository implementation. Reference Prisma implementation: `return (await this.prisma.bruteForceAttempt.deleteMany({ where: { createdAt: { lt: beforeDate } } })).count;`. Multi-replica deployments should coordinate at the cron layer (advisory lock, leader election) or accept the duplicate-delete cost — `DELETE WHERE createdAt < ?` is idempotent.
770
+ This requires `IBruteForceRepository.deleteOlderThan(beforeDate: Date): Promise<number>` on your repository implementation. Reference Prisma implementation: `return (await this.prisma.bruteForceAttempt.deleteMany({ where: { attemptedAt: { lt: beforeDate } } })).count;` — substitute whichever column records when the attempt happened, and check the name against your schema rather than copying it. Multi-replica deployments should coordinate at the cron layer (advisory lock, leader election) or accept the duplicate-delete cost — a timestamp-bounded `DELETE` is idempotent.
769
771
 
770
772
  #### Stay Logged In After Password Change
771
773
 
@@ -1107,6 +1109,17 @@ Token TTL also differs from code TTL: 60 minutes by default
1107
1109
  **`verificationMode: 'code'` — the default — is unaffected.** Behaviour is
1108
1110
  identical, including the legacy `FRONTEND_URL` fallback for the reset page URL.
1109
1111
 
1112
+ **`bcrypt` 5 → 6.** No code change and no hash migration: existing hashes
1113
+ verify unchanged, and hashes written by 0.9.0 still verify if you roll back to
1114
+ 0.8.0. The move exists because bcrypt 5 pulls in `tar@6.2.1` (1 critical, 8
1115
+ high advisories) through `@mapbox/node-pre-gyp`, with no fix on the 5 line.
1116
+
1117
+ - **If your app also depends on `bcrypt` directly, move it to `^6.0.0` in the
1118
+ same deploy.** Otherwise npm installs both, and your bcrypt 5 keeps `tar` in
1119
+ your tree.
1120
+ - **Node.js 18 or later**, now declared in `engines`. It was already required
1121
+ by `google-auth-library@10`, so an install that worked before still works.
1122
+
1110
1123
  **Additive — new behaviour, no action required.**
1111
1124
 
1112
1125
  - `BaseAuthResolver.performRefreshToken` and `performLogout` now fall back to the refresh cookie when `features.cookieAuth: true` and `input.refreshToken` is empty. Your consumer `RefreshTokenInput` / `LogoutInput` DTOs should mark `refreshToken` `@IsOptional()` for browser flows. Explicit `input.refreshToken` still wins for non-browser callers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ambushsoftworks/nestjs-auth-graphql",
3
- "version": "0.9.0-rc.2",
3
+ "version": "0.9.0-rc.3",
4
4
  "description": "Production-grade authentication package for NestJS with GraphQL, supporting JWT, OAuth, email/SMS verification, and biometric auth",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@sendgrid/mail": "^8.1.6",
67
- "bcrypt": "^5.1.1",
67
+ "bcrypt": "^6.0.0",
68
68
  "class-transformer": "^0.5.1",
69
69
  "class-validator": "^0.14.1",
70
70
  "google-auth-library": "^10.5.0",
@@ -78,7 +78,7 @@
78
78
  "@nestjs/config": "^3.3.0",
79
79
  "@nestjs/testing": "^10.3.1",
80
80
  "@nestjs/throttler": "^6.4.0",
81
- "@types/bcrypt": "^5.0.2",
81
+ "@types/bcrypt": "^6.0.0",
82
82
  "@types/jest": "^29.5.11",
83
83
  "@types/node": "^20.11.5",
84
84
  "@types/passport-google-oauth20": "^2.0.17",
@@ -112,5 +112,8 @@
112
112
  ],
113
113
  "coverageDirectory": "../coverage",
114
114
  "testEnvironment": "node"
115
+ },
116
+ "engines": {
117
+ "node": ">=18"
115
118
  }
116
119
  }
@@ -1,73 +0,0 @@
1
- import { AuthService } from '../services/auth.service';
2
- import { AuthResponseBase } from '../dto/auth-response.dto';
3
- import { AuthUser } from '../entities/auth-user.entity';
4
- declare class AuthResponse implements AuthResponseBase<AuthUser> {
5
- accessToken: string;
6
- refreshToken: string;
7
- user: AuthUser;
8
- }
9
- import { AuthSignupInput } from '../dto/signup.input';
10
- import { AuthLoginInput } from '../dto/login.input';
11
- import { AuthRefreshTokenInput } from '../dto/refresh-token.input';
12
- import { AuthLogoutInput } from '../dto/logout.input';
13
- import { AuthLogoutResponse, AuthLogoutAllResponse } from '../dto/logout-response.dto';
14
- import { AuthAccountLockStatus } from '../dto/account-lock-status.dto';
15
- import { AuthVerifyEmailInput } from '../dto/verify-email.input';
16
- import { AuthVerifyEmailResponse } from '../dto/verify-email-response.dto';
17
- import { AuthSendPhoneVerificationInput } from '../dto/send-phone-verification.input';
18
- import { AuthVerifyPhoneInput } from '../dto/verify-phone.input';
19
- import { AuthPhoneVerificationResponse, AuthVerifyPhoneResponse, AuthRemovePhoneResponse } from '../dto/phone-verification-response.dto';
20
- import { AuthPhoneVerificationStatus } from '../dto/phone-verification-status.dto';
21
- import { AuthCompleteFacebookSignUpInput } from '../dto/complete-facebook-signup.input';
22
- import { AuthUnlinkSocialAccountInput } from '../dto/unlink-social-account.input';
23
- import { AuthUnlinkSocialAccountResponse } from '../dto/unlink-social-account-response.dto';
24
- import { AuthEnableBiometricInput } from '../dto/enable-biometric.input';
25
- import { AuthBiometricLoginInput } from '../dto/biometric-login.input';
26
- import { AuthBiometricStatusResponse } from '../dto/biometric-status.dto';
27
- import { EnrollBiometricInput } from '../dto/enroll-biometric.input';
28
- import { VerifyBiometricSignatureInput } from '../dto/verify-biometric-signature.input';
29
- import { BiometricCredentialDto } from '../dto/biometric-credential.dto';
30
- import { BiometricChallengeDto } from '../dto/biometric-challenge.dto';
31
- import { RemoveBiometricDeviceResponse } from '../dto/remove-biometric-device-response.dto';
32
- import { BruteForceProtectionService } from '../services/brute-force-protection.service';
33
- import { OAuthLinkingTokenService } from '../services/oauth-linking-token.service';
34
- import { BiometricAuthService } from '../services/biometric-auth.service';
35
- import { BiometricVerificationService } from '../services/biometric-verification.service';
36
- import { IUserRepository } from '../interfaces/user-repository.interface';
37
- import { IAuthUser } from '../interfaces/auth-user.interface';
38
- export declare class AuthResolver {
39
- private authService;
40
- private bruteForceProtection;
41
- private oauthLinkingTokenService;
42
- private biometricAuthService;
43
- private biometricVerificationService;
44
- private userRepository;
45
- private readonly logger;
46
- constructor(authService: AuthService, bruteForceProtection: BruteForceProtectionService, oauthLinkingTokenService: OAuthLinkingTokenService, biometricAuthService: BiometricAuthService, biometricVerificationService: BiometricVerificationService, userRepository: IUserRepository<IAuthUser>);
47
- signup(input: AuthSignupInput): Promise<AuthResponse>;
48
- login(input: AuthLoginInput, context: any): Promise<AuthResponse>;
49
- refreshToken(input: AuthRefreshTokenInput): Promise<AuthResponse>;
50
- logout(input: AuthLogoutInput, user: IAuthUser): Promise<AuthLogoutResponse>;
51
- logoutAll(user: IAuthUser): Promise<AuthLogoutAllResponse>;
52
- checkAuthAccountLockStatus(email: string): Promise<AuthAccountLockStatus>;
53
- verifyEmail(input: AuthVerifyEmailInput): Promise<AuthVerifyEmailResponse>;
54
- resendVerificationEmail(email: string): Promise<AuthVerifyEmailResponse>;
55
- sendPhoneVerification(input: AuthSendPhoneVerificationInput, user: IAuthUser): Promise<AuthPhoneVerificationResponse>;
56
- verifyPhone(input: AuthVerifyPhoneInput, user: IAuthUser): Promise<AuthVerifyPhoneResponse>;
57
- resendPhoneVerification(phoneNumber: string, user: IAuthUser): Promise<AuthPhoneVerificationResponse>;
58
- removePhoneNumber(user: IAuthUser): Promise<AuthRemovePhoneResponse>;
59
- phoneVerificationStatus(user: IAuthUser): Promise<AuthPhoneVerificationStatus>;
60
- completeFacebookSignUp(input: AuthCompleteFacebookSignUpInput): Promise<AuthResponse>;
61
- unlinkSocialAccount(input: AuthUnlinkSocialAccountInput, user: IAuthUser): Promise<AuthUnlinkSocialAccountResponse>;
62
- enableBiometric(input: AuthEnableBiometricInput, user: IAuthUser): Promise<boolean>;
63
- disableBiometric(user: IAuthUser): Promise<boolean>;
64
- biometricLogin(input: AuthBiometricLoginInput): Promise<AuthResponse>;
65
- biometricStatus(user: IAuthUser): Promise<AuthBiometricStatusResponse>;
66
- enrollBiometric(input: EnrollBiometricInput, user: IAuthUser): Promise<BiometricCredentialDto>;
67
- requestBiometricChallenge(deviceId: string, user: IAuthUser): Promise<BiometricChallengeDto>;
68
- verifyBiometricSignature(input: VerifyBiometricSignatureInput): Promise<AuthResponse>;
69
- removeBiometricDevice(deviceId: string, user: IAuthUser): Promise<RemoveBiometricDeviceResponse>;
70
- biometricDevices(user: IAuthUser): Promise<BiometricCredentialDto[]>;
71
- }
72
- export {};
73
- //# sourceMappingURL=auth.resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/auth.resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,cACM,YAAa,YAAW,gBAAgB,CAAC,QAAQ,CAAC;IAEtD,WAAW,EAAE,MAAM,CAAC;IAGpB,YAAY,EAA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Q,EAAE,MAAM,EACnB,IAAI,EAAE,SAAS,GAC7B,OAAO,CAAC,qBAAqB,CAAC;IAkC3B,wBAAwB,CACb,KAAK,EAAE,6BAA6B,GAClD,OAAO,CAAC,YAAY,CAAC;IA6BlB,qBAAqB,CACP,QAAQ,EAAE,MAAM,EACnB,IAAI,EAAE,SAAS,GAC7B,OAAO,CAAC,6BAA6B,CAAC;IA0BnC,gBAAgB,CACL,IAAI,EAAE,SAAS,GAC7B,OAAO,CAAC,sBAAsB,EAAE,CAAC;CAMrC"}
@@ -1,472 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var AuthResolver_1;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.AuthResolver = void 0;
17
- const graphql_1 = require("@nestjs/graphql");
18
- const common_1 = require("@nestjs/common");
19
- const throttler_1 = require("@nestjs/throttler");
20
- const graphql_2 = require("@nestjs/graphql");
21
- const auth_service_1 = require("../services/auth.service");
22
- const jwt_auth_guard_1 = require("../guards/jwt-auth.guard");
23
- const current_user_decorator_1 = require("../decorators/current-user.decorator");
24
- const auth_user_entity_1 = require("../entities/auth-user.entity");
25
- let AuthResponse = class AuthResponse {
26
- };
27
- __decorate([
28
- (0, graphql_2.Field)(),
29
- __metadata("design:type", String)
30
- ], AuthResponse.prototype, "accessToken", void 0);
31
- __decorate([
32
- (0, graphql_2.Field)(),
33
- __metadata("design:type", String)
34
- ], AuthResponse.prototype, "refreshToken", void 0);
35
- __decorate([
36
- (0, graphql_2.Field)(() => auth_user_entity_1.AuthUser),
37
- __metadata("design:type", auth_user_entity_1.AuthUser)
38
- ], AuthResponse.prototype, "user", void 0);
39
- AuthResponse = __decorate([
40
- (0, graphql_2.ObjectType)()
41
- ], AuthResponse);
42
- const signup_input_1 = require("../dto/signup.input");
43
- const login_input_1 = require("../dto/login.input");
44
- const refresh_token_input_1 = require("../dto/refresh-token.input");
45
- const logout_input_1 = require("../dto/logout.input");
46
- const logout_response_dto_1 = require("../dto/logout-response.dto");
47
- const account_lock_status_dto_1 = require("../dto/account-lock-status.dto");
48
- const verify_email_input_1 = require("../dto/verify-email.input");
49
- const verify_email_response_dto_1 = require("../dto/verify-email-response.dto");
50
- const send_phone_verification_input_1 = require("../dto/send-phone-verification.input");
51
- const verify_phone_input_1 = require("../dto/verify-phone.input");
52
- const phone_verification_response_dto_1 = require("../dto/phone-verification-response.dto");
53
- const phone_verification_status_dto_1 = require("../dto/phone-verification-status.dto");
54
- const complete_facebook_signup_input_1 = require("../dto/complete-facebook-signup.input");
55
- const unlink_social_account_input_1 = require("../dto/unlink-social-account.input");
56
- const unlink_social_account_response_dto_1 = require("../dto/unlink-social-account-response.dto");
57
- const enable_biometric_input_1 = require("../dto/enable-biometric.input");
58
- const biometric_login_input_1 = require("../dto/biometric-login.input");
59
- const biometric_status_dto_1 = require("../dto/biometric-status.dto");
60
- const enroll_biometric_input_1 = require("../dto/enroll-biometric.input");
61
- const verify_biometric_signature_input_1 = require("../dto/verify-biometric-signature.input");
62
- const biometric_credential_dto_1 = require("../dto/biometric-credential.dto");
63
- const biometric_challenge_dto_1 = require("../dto/biometric-challenge.dto");
64
- const remove_biometric_device_response_dto_1 = require("../dto/remove-biometric-device-response.dto");
65
- const brute_force_protection_service_1 = require("../services/brute-force-protection.service");
66
- const oauth_linking_token_service_1 = require("../services/oauth-linking-token.service");
67
- const biometric_auth_service_1 = require("../services/biometric-auth.service");
68
- const biometric_verification_service_1 = require("../services/biometric-verification.service");
69
- let AuthResolver = AuthResolver_1 = class AuthResolver {
70
- constructor(authService, bruteForceProtection, oauthLinkingTokenService, biometricAuthService, biometricVerificationService, userRepository) {
71
- this.authService = authService;
72
- this.bruteForceProtection = bruteForceProtection;
73
- this.oauthLinkingTokenService = oauthLinkingTokenService;
74
- this.biometricAuthService = biometricAuthService;
75
- this.biometricVerificationService = biometricVerificationService;
76
- this.userRepository = userRepository;
77
- this.logger = new common_1.Logger(AuthResolver_1.name);
78
- }
79
- async signup(input) {
80
- const result = await this.authService.signup(input.email, input.password);
81
- return {
82
- ...result,
83
- user: auth_user_entity_1.AuthUser.fromInterface(result.user),
84
- };
85
- }
86
- async login(input, context) {
87
- const ipAddress = context.req?.clientIp || context.req?.ip || 'unknown';
88
- this.logger.log(`[AUTH_RESOLVER] Login attempt for email: ${input.email} from IP: ${ipAddress}`);
89
- const result = await this.authService.login(input.email, input.password, ipAddress);
90
- return {
91
- ...result,
92
- user: auth_user_entity_1.AuthUser.fromInterface(result.user),
93
- };
94
- }
95
- async refreshToken(input) {
96
- const result = await this.authService.refreshToken(input.refreshToken);
97
- return {
98
- ...result,
99
- user: auth_user_entity_1.AuthUser.fromInterface(result.user),
100
- };
101
- }
102
- async logout(input, user) {
103
- const success = await this.authService.logout(input.refreshToken, user.id);
104
- return {
105
- success,
106
- message: success
107
- ? 'Successfully logged out'
108
- : 'Refresh token not found or already invalidated',
109
- };
110
- }
111
- async logoutAll(user) {
112
- const count = await this.authService.logoutAll(user.id);
113
- return {
114
- count,
115
- message: `Successfully logged out from ${count} device(s)`,
116
- };
117
- }
118
- async checkAuthAccountLockStatus(email) {
119
- const locked = await this.bruteForceProtection.isAccountLocked(email);
120
- const remainingTime = locked
121
- ? await this.bruteForceProtection.getRemainingLockoutTime(email)
122
- : 0;
123
- return {
124
- locked,
125
- remainingTime,
126
- };
127
- }
128
- async verifyEmail(input) {
129
- return this.authService.verifyEmail(input.email, input.code);
130
- }
131
- async resendVerificationEmail(email) {
132
- return this.authService.resendVerificationEmail(email);
133
- }
134
- async sendPhoneVerification(input, user) {
135
- return this.authService.sendPhoneVerification(user.id, input.phoneNumber, input.countryCode);
136
- }
137
- async verifyPhone(input, user) {
138
- return this.authService.verifyPhone(user.id, input.phoneNumber, input.code);
139
- }
140
- async resendPhoneVerification(phoneNumber, user) {
141
- return this.authService.resendPhoneVerification(user.id, phoneNumber);
142
- }
143
- async removePhoneNumber(user) {
144
- return this.authService.removePhoneNumber(user.id);
145
- }
146
- async phoneVerificationStatus(user) {
147
- const userRecord = await this.userRepository.findById(user.id);
148
- if (!userRecord) {
149
- throw new Error('User not found');
150
- }
151
- let canResendInSeconds = undefined;
152
- if (userRecord.phoneVerificationSentAt) {
153
- const timeSinceLastSent = Date.now() - userRecord.phoneVerificationSentAt.getTime();
154
- const cooldownMs = 60 * 1000;
155
- if (timeSinceLastSent < cooldownMs) {
156
- canResendInSeconds = Math.ceil((cooldownMs - timeSinceLastSent) / 1000);
157
- }
158
- }
159
- let maskedPhoneNumber = undefined;
160
- if (userRecord.phoneNumber) {
161
- maskedPhoneNumber = this.authService['smsService'].maskPhoneNumber(userRecord.phoneNumber);
162
- }
163
- return {
164
- phoneVerified: userRecord.phoneVerified ?? false,
165
- phoneNumber: userRecord.phoneNumber || undefined,
166
- phoneVerifiedAt: userRecord.phoneVerifiedAt || undefined,
167
- maskedPhoneNumber,
168
- phoneVerificationSentAt: userRecord.phoneVerificationSentAt || undefined,
169
- canResendInSeconds,
170
- };
171
- }
172
- async completeFacebookSignUp(input) {
173
- this.logger.log('[AUTH_RESOLVER] ===== COMPLETE FACEBOOK SIGN-UP =====');
174
- this.logger.log(`[AUTH_RESOLVER] Email: ${input.email}`);
175
- const result = await this.authService.completeFacebookSignUp(input.fallbackToken, input.email, input.accessToken);
176
- this.logger.log(`[AUTH_RESOLVER] Successfully completed Facebook sign-up for user: ${result.user.id}`);
177
- this.logger.log(`[AUTH_RESOLVER] NOTE: Email verification required before app access`);
178
- return {
179
- ...result,
180
- user: auth_user_entity_1.AuthUser.fromInterface(result.user),
181
- };
182
- }
183
- async unlinkSocialAccount(input, user) {
184
- this.logger.log(`[AUTH_RESOLVER] Unlink ${input.provider} account for user: ${user.id}`);
185
- const result = await this.authService.unlinkSocialAccount(user.id, input.provider);
186
- this.logger.log(`[AUTH_RESOLVER] Successfully unlinked ${input.provider} account for user: ${user.id}`);
187
- return {
188
- ...result,
189
- user: auth_user_entity_1.AuthUser.fromInterface(result.user),
190
- };
191
- }
192
- async enableBiometric(input, user) {
193
- this.logger.log(`[AUTH_RESOLVER] Enable biometric for user: ${user.id} on device: ${input.deviceId}`);
194
- const result = await this.biometricAuthService.enableBiometric(user.id, input.deviceId, input.publicKey);
195
- this.logger.log(`[AUTH_RESOLVER] Successfully enabled biometric for user: ${user.id}`);
196
- return result;
197
- }
198
- async disableBiometric(user) {
199
- this.logger.log(`[AUTH_RESOLVER] Disable biometric for user: ${user.id}`);
200
- const result = await this.biometricAuthService.disableBiometric(user.id);
201
- this.logger.log(`[AUTH_RESOLVER] Successfully disabled biometric for user: ${user.id}`);
202
- return result;
203
- }
204
- async biometricLogin(input) {
205
- this.logger.log(`[AUTH_RESOLVER] Biometric login attempt for user: ${input.userId}`);
206
- const result = await this.biometricAuthService.authenticateWithBiometric(input.userId, input.deviceId);
207
- this.logger.log(`[AUTH_RESOLVER] Successfully authenticated user via biometric: ${input.userId}`);
208
- const user = await this.userRepository.findById(input.userId);
209
- if (!user) {
210
- throw new common_1.UnauthorizedException('User not found');
211
- }
212
- return {
213
- accessToken: result.accessToken,
214
- refreshToken: result.refreshToken,
215
- user: auth_user_entity_1.AuthUser.fromInterface(user),
216
- };
217
- }
218
- async biometricStatus(user) {
219
- const status = await this.biometricAuthService.getBiometricStatus(user.id);
220
- return {
221
- enabled: status.enabled,
222
- deviceId: status.deviceId || undefined,
223
- };
224
- }
225
- async enrollBiometric(input, user) {
226
- this.logger.log(`[AUTH_RESOLVER] Enroll biometric for user: ${user.id} device: ${input.deviceId}`);
227
- throw new Error('enrollBiometric not implemented - requires IBiometricRepository implementation. See README.md');
228
- }
229
- async requestBiometricChallenge(deviceId, user) {
230
- this.logger.log(`[AUTH_RESOLVER] Request biometric challenge for user: ${user.id} device: ${deviceId}`);
231
- throw new Error('requestBiometricChallenge not implemented - requires IBiometricRepository implementation. See README.md');
232
- }
233
- async verifyBiometricSignature(input) {
234
- this.logger.log(`[AUTH_RESOLVER] Verify biometric signature for challenge: ${input.challengeId}`);
235
- throw new Error('verifyBiometricSignature not implemented - requires IBiometricRepository implementation. See README.md');
236
- }
237
- async removeBiometricDevice(deviceId, user) {
238
- this.logger.log(`[AUTH_RESOLVER] Remove biometric device ${deviceId} for user: ${user.id}`);
239
- throw new Error('removeBiometricDevice not implemented - requires IBiometricRepository implementation. See README.md');
240
- }
241
- async biometricDevices(user) {
242
- throw new Error('biometricDevices not implemented - requires IBiometricRepository implementation. See README.md');
243
- }
244
- };
245
- exports.AuthResolver = AuthResolver;
246
- __decorate([
247
- (0, graphql_1.Mutation)(() => AuthResponse),
248
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
249
- __param(0, (0, graphql_1.Args)('input')),
250
- __metadata("design:type", Function),
251
- __metadata("design:paramtypes", [signup_input_1.AuthSignupInput]),
252
- __metadata("design:returntype", Promise)
253
- ], AuthResolver.prototype, "signup", null);
254
- __decorate([
255
- (0, graphql_1.Mutation)(() => AuthResponse),
256
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
257
- __param(0, (0, graphql_1.Args)('input')),
258
- __param(1, (0, graphql_1.Context)()),
259
- __metadata("design:type", Function),
260
- __metadata("design:paramtypes", [login_input_1.AuthLoginInput, Object]),
261
- __metadata("design:returntype", Promise)
262
- ], AuthResolver.prototype, "login", null);
263
- __decorate([
264
- (0, graphql_1.Mutation)(() => AuthResponse),
265
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
266
- __param(0, (0, graphql_1.Args)('input')),
267
- __metadata("design:type", Function),
268
- __metadata("design:paramtypes", [refresh_token_input_1.AuthRefreshTokenInput]),
269
- __metadata("design:returntype", Promise)
270
- ], AuthResolver.prototype, "refreshToken", null);
271
- __decorate([
272
- (0, graphql_1.Mutation)(() => logout_response_dto_1.AuthLogoutResponse),
273
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
274
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
275
- __param(0, (0, graphql_1.Args)('input')),
276
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
277
- __metadata("design:type", Function),
278
- __metadata("design:paramtypes", [logout_input_1.AuthLogoutInput, Object]),
279
- __metadata("design:returntype", Promise)
280
- ], AuthResolver.prototype, "logout", null);
281
- __decorate([
282
- (0, graphql_1.Mutation)(() => logout_response_dto_1.AuthLogoutAllResponse),
283
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
284
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
285
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
286
- __metadata("design:type", Function),
287
- __metadata("design:paramtypes", [Object]),
288
- __metadata("design:returntype", Promise)
289
- ], AuthResolver.prototype, "logoutAll", null);
290
- __decorate([
291
- (0, graphql_1.Query)(() => account_lock_status_dto_1.AuthAccountLockStatus),
292
- (0, throttler_1.Throttle)({ default: { limit: 20, ttl: 60000 } }),
293
- __param(0, (0, graphql_1.Args)('email')),
294
- __metadata("design:type", Function),
295
- __metadata("design:paramtypes", [String]),
296
- __metadata("design:returntype", Promise)
297
- ], AuthResolver.prototype, "checkAuthAccountLockStatus", null);
298
- __decorate([
299
- (0, graphql_1.Mutation)(() => verify_email_response_dto_1.AuthVerifyEmailResponse),
300
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
301
- __param(0, (0, graphql_1.Args)('input')),
302
- __metadata("design:type", Function),
303
- __metadata("design:paramtypes", [verify_email_input_1.AuthVerifyEmailInput]),
304
- __metadata("design:returntype", Promise)
305
- ], AuthResolver.prototype, "verifyEmail", null);
306
- __decorate([
307
- (0, graphql_1.Mutation)(() => verify_email_response_dto_1.AuthVerifyEmailResponse),
308
- (0, throttler_1.Throttle)({ default: { limit: 3, ttl: 60000 } }),
309
- __param(0, (0, graphql_1.Args)('email')),
310
- __metadata("design:type", Function),
311
- __metadata("design:paramtypes", [String]),
312
- __metadata("design:returntype", Promise)
313
- ], AuthResolver.prototype, "resendVerificationEmail", null);
314
- __decorate([
315
- (0, graphql_1.Mutation)(() => phone_verification_response_dto_1.AuthPhoneVerificationResponse),
316
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
317
- (0, throttler_1.Throttle)({ default: { limit: 3, ttl: 60000 } }),
318
- __param(0, (0, graphql_1.Args)('input')),
319
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
320
- __metadata("design:type", Function),
321
- __metadata("design:paramtypes", [send_phone_verification_input_1.AuthSendPhoneVerificationInput, Object]),
322
- __metadata("design:returntype", Promise)
323
- ], AuthResolver.prototype, "sendPhoneVerification", null);
324
- __decorate([
325
- (0, graphql_1.Mutation)(() => phone_verification_response_dto_1.AuthVerifyPhoneResponse),
326
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
327
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
328
- __param(0, (0, graphql_1.Args)('input')),
329
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
330
- __metadata("design:type", Function),
331
- __metadata("design:paramtypes", [verify_phone_input_1.AuthVerifyPhoneInput, Object]),
332
- __metadata("design:returntype", Promise)
333
- ], AuthResolver.prototype, "verifyPhone", null);
334
- __decorate([
335
- (0, graphql_1.Mutation)(() => phone_verification_response_dto_1.AuthPhoneVerificationResponse),
336
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
337
- (0, throttler_1.Throttle)({ default: { limit: 3, ttl: 60000 } }),
338
- __param(0, (0, graphql_1.Args)('phoneNumber')),
339
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
340
- __metadata("design:type", Function),
341
- __metadata("design:paramtypes", [String, Object]),
342
- __metadata("design:returntype", Promise)
343
- ], AuthResolver.prototype, "resendPhoneVerification", null);
344
- __decorate([
345
- (0, graphql_1.Mutation)(() => phone_verification_response_dto_1.AuthRemovePhoneResponse),
346
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
347
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
348
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
349
- __metadata("design:type", Function),
350
- __metadata("design:paramtypes", [Object]),
351
- __metadata("design:returntype", Promise)
352
- ], AuthResolver.prototype, "removePhoneNumber", null);
353
- __decorate([
354
- (0, graphql_1.Query)(() => phone_verification_status_dto_1.AuthPhoneVerificationStatus),
355
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
356
- (0, throttler_1.Throttle)({ default: { limit: 20, ttl: 60000 } }),
357
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
358
- __metadata("design:type", Function),
359
- __metadata("design:paramtypes", [Object]),
360
- __metadata("design:returntype", Promise)
361
- ], AuthResolver.prototype, "phoneVerificationStatus", null);
362
- __decorate([
363
- (0, graphql_1.Mutation)(() => AuthResponse),
364
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 900000 } }),
365
- __param(0, (0, graphql_1.Args)('input')),
366
- __metadata("design:type", Function),
367
- __metadata("design:paramtypes", [complete_facebook_signup_input_1.AuthCompleteFacebookSignUpInput]),
368
- __metadata("design:returntype", Promise)
369
- ], AuthResolver.prototype, "completeFacebookSignUp", null);
370
- __decorate([
371
- (0, graphql_1.Mutation)(() => unlink_social_account_response_dto_1.AuthUnlinkSocialAccountResponse),
372
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
373
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
374
- __param(0, (0, graphql_1.Args)('input')),
375
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
376
- __metadata("design:type", Function),
377
- __metadata("design:paramtypes", [unlink_social_account_input_1.AuthUnlinkSocialAccountInput, Object]),
378
- __metadata("design:returntype", Promise)
379
- ], AuthResolver.prototype, "unlinkSocialAccount", null);
380
- __decorate([
381
- (0, graphql_1.Mutation)(() => Boolean),
382
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
383
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
384
- __param(0, (0, graphql_1.Args)('input')),
385
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
386
- __metadata("design:type", Function),
387
- __metadata("design:paramtypes", [enable_biometric_input_1.AuthEnableBiometricInput, Object]),
388
- __metadata("design:returntype", Promise)
389
- ], AuthResolver.prototype, "enableBiometric", null);
390
- __decorate([
391
- (0, graphql_1.Mutation)(() => Boolean),
392
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
393
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
394
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
395
- __metadata("design:type", Function),
396
- __metadata("design:paramtypes", [Object]),
397
- __metadata("design:returntype", Promise)
398
- ], AuthResolver.prototype, "disableBiometric", null);
399
- __decorate([
400
- (0, graphql_1.Mutation)(() => AuthResponse),
401
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
402
- __param(0, (0, graphql_1.Args)('input')),
403
- __metadata("design:type", Function),
404
- __metadata("design:paramtypes", [biometric_login_input_1.AuthBiometricLoginInput]),
405
- __metadata("design:returntype", Promise)
406
- ], AuthResolver.prototype, "biometricLogin", null);
407
- __decorate([
408
- (0, graphql_1.Query)(() => biometric_status_dto_1.AuthBiometricStatusResponse),
409
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
410
- (0, throttler_1.Throttle)({ default: { limit: 20, ttl: 60000 } }),
411
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
412
- __metadata("design:type", Function),
413
- __metadata("design:paramtypes", [Object]),
414
- __metadata("design:returntype", Promise)
415
- ], AuthResolver.prototype, "biometricStatus", null);
416
- __decorate([
417
- (0, graphql_1.Mutation)(() => biometric_credential_dto_1.BiometricCredentialDto),
418
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
419
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
420
- __param(0, (0, graphql_1.Args)('input')),
421
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
422
- __metadata("design:type", Function),
423
- __metadata("design:paramtypes", [enroll_biometric_input_1.EnrollBiometricInput, Object]),
424
- __metadata("design:returntype", Promise)
425
- ], AuthResolver.prototype, "enrollBiometric", null);
426
- __decorate([
427
- (0, graphql_1.Mutation)(() => biometric_challenge_dto_1.BiometricChallengeDto),
428
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
429
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
430
- __param(0, (0, graphql_1.Args)('deviceId')),
431
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
432
- __metadata("design:type", Function),
433
- __metadata("design:paramtypes", [String, Object]),
434
- __metadata("design:returntype", Promise)
435
- ], AuthResolver.prototype, "requestBiometricChallenge", null);
436
- __decorate([
437
- (0, graphql_1.Mutation)(() => AuthResponse),
438
- (0, throttler_1.Throttle)({ default: { limit: 10, ttl: 60000 } }),
439
- __param(0, (0, graphql_1.Args)('input')),
440
- __metadata("design:type", Function),
441
- __metadata("design:paramtypes", [verify_biometric_signature_input_1.VerifyBiometricSignatureInput]),
442
- __metadata("design:returntype", Promise)
443
- ], AuthResolver.prototype, "verifyBiometricSignature", null);
444
- __decorate([
445
- (0, graphql_1.Mutation)(() => remove_biometric_device_response_dto_1.RemoveBiometricDeviceResponse),
446
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
447
- (0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
448
- __param(0, (0, graphql_1.Args)('deviceId')),
449
- __param(1, (0, current_user_decorator_1.CurrentUser)()),
450
- __metadata("design:type", Function),
451
- __metadata("design:paramtypes", [String, Object]),
452
- __metadata("design:returntype", Promise)
453
- ], AuthResolver.prototype, "removeBiometricDevice", null);
454
- __decorate([
455
- (0, graphql_1.Query)(() => [biometric_credential_dto_1.BiometricCredentialDto]),
456
- (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard),
457
- (0, throttler_1.Throttle)({ default: { limit: 20, ttl: 60000 } }),
458
- __param(0, (0, current_user_decorator_1.CurrentUser)()),
459
- __metadata("design:type", Function),
460
- __metadata("design:paramtypes", [Object]),
461
- __metadata("design:returntype", Promise)
462
- ], AuthResolver.prototype, "biometricDevices", null);
463
- exports.AuthResolver = AuthResolver = AuthResolver_1 = __decorate([
464
- (0, graphql_1.Resolver)(),
465
- __param(5, (0, common_1.Inject)('USER_REPOSITORY')),
466
- __metadata("design:paramtypes", [auth_service_1.AuthService,
467
- brute_force_protection_service_1.BruteForceProtectionService,
468
- oauth_linking_token_service_1.OAuthLinkingTokenService,
469
- biometric_auth_service_1.BiometricAuthService,
470
- biometric_verification_service_1.BiometricVerificationService, Object])
471
- ], AuthResolver);
472
- //# sourceMappingURL=auth.resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.resolver.js","sourceRoot":"","sources":["../../src/resolvers/auth.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2E;AAC3E,2CAAqG;AACrG,iDAA6C;AAC7C,6CAAoD;AACpD,2DAAuD;AACvD,6DAAwD;AACxD,iFAAmE;AAEnE,mEAAwD;AAIxD,IAAM,YAAY,GAAlB,MAAM,YAAY;CASjB,CAAA;AAPC;IADC,IAAA,eAAK,GAAE;;iD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U,CAAC,CAAA;IAChB,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;6DAUf;AAyBK;IAFL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,YAAY,CAAC;IAC5B,IAAA,oBAAQ,EAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;IAE9C,WAAA,IAAA,cAAI,EAAC,OAAO,CAAC,CAAA;;qCAAQ,gEAA6B;;4DAUpD;AAoBK;IAHL,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,oEAA6B,CAAC;IAC7C,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,oBAAQ,EAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;IAE7C,WAAA,IAAA,cAAI,EAAC,UAAU,CAAC,CAAA;IAChB,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;yDAUf;AAiBK;IAHL,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,iDAAsB,CAAC,CAAC;IACrC,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,oBAAQ,EAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;IAE9C,WAAA,IAAA,oCAAW,GAAE,CAAA;;;;oDAMf;uBAzmBU,YAAY;IADxB,IAAA,kBAAQ,GAAE;IAYN,WAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;qCAPL,0BAAW;QACF,4DAA2B;QAEvB,sDAAwB;QAC5B,6CAAoB;QAEZ,6DAA4B;GAVzD,YAAY,CA0mBxB"}
@@ -1,11 +0,0 @@
1
- export interface PassportInstanceInfo {
2
- instanceId: string;
3
- modulePath: string;
4
- registeredStrategies: string[];
5
- timestamp: string;
6
- inspectionPoint: string;
7
- }
8
- export declare function inspectPassportInstance(passportInstance: any, inspectionPoint: string): PassportInstanceInfo;
9
- export declare function logPassportInstanceInfo(info: PassportInstanceInfo): void;
10
- export declare function arePassportInstancesDifferent(info1: PassportInstanceInfo, info2: PassportInstanceInfo): boolean;
11
- //# sourceMappingURL=passport-inspector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"passport-inspector.d.ts","sourceRoot":"","sources":["../../src/utils/passport-inspector.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,oBAAoB;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IAEnB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAE/B,SAAS,EAAE,MAAM,CAAC;IAElB,eAAe,EAAE,MAAM,CAAC;CACzB;AASD,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,GAAG,EACrB,eAAe,EAAE,MAAM,GACtB,oBAAoB,CAsBtB;AAOD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAOxE;AASD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAiBT"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.inspectPassportInstance = inspectPassportInstance;
4
- exports.logPassportInstanceInfo = logPassportInstanceInfo;
5
- exports.arePassportInstancesDifferent = arePassportInstancesDifferent;
6
- function inspectPassportInstance(passportInstance, inspectionPoint) {
7
- const instanceId = Object.prototype.toString.call(passportInstance);
8
- let modulePath;
9
- try {
10
- modulePath = require.resolve('passport');
11
- }
12
- catch (error) {
13
- modulePath = 'UNKNOWN - require.resolve failed';
14
- }
15
- const registeredStrategies = Object.keys(passportInstance._strategies || {});
16
- return {
17
- instanceId,
18
- modulePath,
19
- registeredStrategies,
20
- timestamp: new Date().toISOString(),
21
- inspectionPoint,
22
- };
23
- }
24
- function logPassportInstanceInfo(info) {
25
- console.log(`[PASSPORT-DEBUG:${info.inspectionPoint}] Passport Instance Inspection:`);
26
- console.log(` Timestamp: ${info.timestamp}`);
27
- console.log(` Instance ID: ${info.instanceId}`);
28
- console.log(` Module Path: ${info.modulePath}`);
29
- console.log(` Registered Strategies: [${info.registeredStrategies.join(', ')}]`);
30
- console.log(` Strategy Count: ${info.registeredStrategies.length}`);
31
- }
32
- function arePassportInstancesDifferent(info1, info2) {
33
- const differentModule = info1.modulePath !== info2.modulePath;
34
- const differentInstance = info1.instanceId !== info2.instanceId;
35
- if (differentModule || differentInstance) {
36
- console.log('[PASSPORT-DEBUG:Comparison] MULTIPLE PASSPORT INSTANCES DETECTED!');
37
- console.log(` ${info1.inspectionPoint}:`);
38
- console.log(` Module: ${info1.modulePath}`);
39
- console.log(` Instance: ${info1.instanceId}`);
40
- console.log(` ${info2.inspectionPoint}:`);
41
- console.log(` Module: ${info2.modulePath}`);
42
- console.log(` Instance: ${info2.instanceId}`);
43
- return true;
44
- }
45
- console.log('[PASSPORT-DEBUG:Comparison] Same Passport instance confirmed');
46
- return false;
47
- }
48
- //# sourceMappingURL=passport-inspector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"passport-inspector.js","sourceRoot":"","sources":["../../src/utils/passport-inspector.ts"],"names":[],"mappings":";;AA4BA,0DAyBC;AAOD,0DAOC;AASD,sEAoBC;AApED,SAAgB,uBAAuB,CACrC,gBAAqB,EACrB,eAAuB;IAGvB,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAGpE,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,GAAG,kCAAkC,CAAC;IAClD,CAAC;IAGD,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,gBAA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