@ambushsoftworks/nestjs-auth-graphql 0.9.0 → 0.10.0
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 +142 -6
- package/README.md +133 -9
- package/dist/auth.module.d.ts +5 -0
- package/dist/auth.module.d.ts.map +1 -1
- package/dist/auth.module.js +22 -2
- package/dist/auth.module.js.map +1 -1
- package/dist/exceptions/oauth.exceptions.d.ts +4 -1
- package/dist/exceptions/oauth.exceptions.d.ts.map +1 -1
- package/dist/exceptions/oauth.exceptions.js +12 -1
- package/dist/exceptions/oauth.exceptions.js.map +1 -1
- package/dist/guards/jwt-auth.guard.d.ts +1 -1
- package/dist/guards/jwt-auth.guard.d.ts.map +1 -1
- package/dist/guards/jwt-auth.guard.js +2 -3
- package/dist/guards/jwt-auth.guard.js.map +1 -1
- package/dist/interfaces/refresh-token-repository.interface.d.ts.map +1 -1
- package/dist/middleware/realm.middleware.d.ts +4 -1
- package/dist/middleware/realm.middleware.d.ts.map +1 -1
- package/dist/middleware/realm.middleware.js +32 -2
- package/dist/middleware/realm.middleware.js.map +1 -1
- package/dist/resolvers/base-auth.resolver.d.ts.map +1 -1
- package/dist/resolvers/base-auth.resolver.js +2 -1
- package/dist/resolvers/base-auth.resolver.js.map +1 -1
- package/dist/resolvers/oauth.controller.d.ts.map +1 -1
- package/dist/resolvers/oauth.controller.js +27 -17
- package/dist/resolvers/oauth.controller.js.map +1 -1
- package/dist/resolvers/rest-error.interceptor.d.ts +7 -0
- package/dist/resolvers/rest-error.interceptor.d.ts.map +1 -0
- package/dist/resolvers/rest-error.interceptor.js +36 -0
- package/dist/resolvers/rest-error.interceptor.js.map +1 -0
- package/dist/services/auth.service.d.ts +1 -0
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +3 -0
- package/dist/services/auth.service.js.map +1 -1
- package/dist/strategies/api-key.strategy.d.ts.map +1 -1
- package/dist/strategies/api-key.strategy.js +1 -1
- package/dist/strategies/api-key.strategy.js.map +1 -1
- package/dist/strategies/noop-facebook.strategy.d.ts.map +1 -1
- package/dist/strategies/noop-facebook.strategy.js +2 -1
- package/dist/strategies/noop-facebook.strategy.js.map +1 -1
- package/dist/strategies/noop-google.strategy.d.ts.map +1 -1
- package/dist/strategies/noop-google.strategy.js +2 -1
- package/dist/strategies/noop-google.strategy.js.map +1 -1
- package/dist/utils/request-realm.d.ts +2 -0
- package/dist/utils/request-realm.d.ts.map +1 -0
- package/dist/utils/request-realm.js +12 -0
- package/dist/utils/request-realm.js.map +1 -0
- package/package.json +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,139 @@ for buried obligations. **The marker was introduced in 0.9.0 and has not been
|
|
|
27
27
|
retro-applied**, so it is reliable from 0.9.0 onward only. Convention adopted
|
|
28
28
|
from `@ambushsoftworks/nestjs-payments-graphql`.
|
|
29
29
|
|
|
30
|
+
## [0.10.0] - 2026-09-15
|
|
31
|
+
|
|
32
|
+
Ambush Desk, a new consumer on NestJS 11, asked for routes that need no realm, a
|
|
33
|
+
way to leave the OAuth REST routes unmounted, and CI on NestJS 11. Building those
|
|
34
|
+
turned up defects on the OAuth REST routes that affect every app mounting them
|
|
35
|
+
today. See **Fixed** first.
|
|
36
|
+
|
|
37
|
+
Behaviour changes, so the minor version moves. See **Migrating to v0.10.0** in
|
|
38
|
+
the README.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- **The OAuth REST routes answered 500 for four ordinary failures.** On
|
|
42
|
+
`POST /auth/google/token` and `POST /auth/facebook/token`:
|
|
43
|
+
|
|
44
|
+
| Situation | Before | Now |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Provider not configured | 500 | 404 `OAUTH_PROVIDER_NOT_CONFIGURED`, with `provider` |
|
|
47
|
+
| Account locked | 500 | 403 `ACCOUNT_LOCKED`, with `remainingLockoutTime` |
|
|
48
|
+
| Account suspended or deleted | 500 | 403 `ACCOUNT_INACTIVE` |
|
|
49
|
+
| Client IP over `bruteForce.ipRateLimit` | 500 | 429 `RATE_LIMIT_EXCEEDED` |
|
|
50
|
+
|
|
51
|
+
The no-op strategies and the controller's lockout and rate-limit checks threw
|
|
52
|
+
plain `Error`. `AccountLockedException` and `AccountInactiveException` extend
|
|
53
|
+
`GraphQLError`, which Nest's HTTP layer does not recognise, so since 0.9.0 a
|
|
54
|
+
suspended user signing in with Google also got a 500. The bodies now use the
|
|
55
|
+
root-level shape of the other OAuth errors: `message`, `code`, `statusCode`,
|
|
56
|
+
plus fields. An internal `RestErrorInterceptor` converts the GraphQL-shaped
|
|
57
|
+
errors on these routes only; GraphQL responses are unchanged. The lockout
|
|
58
|
+
message is now the one `login` uses.
|
|
59
|
+
- **`createAuthGuard(['api-key', 'jwt'])` rejected every JWT.** `ApiKeyStrategy`
|
|
60
|
+
threw for a bearer token that matched no key, and a throw stops Passport's
|
|
61
|
+
strategy chain, so JWT was never tried. That is the order the README and
|
|
62
|
+
`createAuthGuard`'s JSDoc showed. An unknown token now fails softly and the next
|
|
63
|
+
strategy runs, so either order accepts either credential. A key whose account is
|
|
64
|
+
inactive still fails with 401 `API key is inactive`. Reported by Ambush Desk.
|
|
65
|
+
- **The OAuth routes checked lockout and the IP rate limit, and reset failed
|
|
66
|
+
attempts, without the realm.** With realms enabled, `isAccountLocked`,
|
|
67
|
+
`getRemainingLockoutTime`, `checkIpRateLimit` and `resetFailedAttempts` were
|
|
68
|
+
called with no realm. Depending on how your repository treats a missing realm,
|
|
69
|
+
a lock could apply to the same email in another realm, and a successful sign-in
|
|
70
|
+
could clear another realm's failed attempts. They now receive the request's
|
|
71
|
+
realm, as `login` already did.
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
- **`realm.skip: (path, request) => boolean`.** Requests that have no realm by
|
|
75
|
+
nature, such as health checks, webhooks and public downloads, pass
|
|
76
|
+
`RealmMiddleware` without calling the extractor, get no `_realm`, and never
|
|
77
|
+
answer `400 Realm required`. Requested by Ambush Desk.
|
|
78
|
+
- `path` is the requested path, including any global prefix and without the
|
|
79
|
+
query string. Do not match on `request.path` or `request.url`: Express
|
|
80
|
+
rewrites both to `/` inside middleware.
|
|
81
|
+
- Only a synchronous `true` skips. A throw or any other return value fails
|
|
82
|
+
closed and is logged.
|
|
83
|
+
- It is a predicate rather than route patterns because the same Nest route
|
|
84
|
+
pattern matches different paths on NestJS 10 and 11: `hooks/*` excludes
|
|
85
|
+
`/hooks/glitchtip/issue` on 11 but not on 10.
|
|
86
|
+
- With realms enabled, a `skip` that is not a function fails boot with
|
|
87
|
+
`InvalidAuthConfigException`. `skip` without `realmExtractorInstance` logs a
|
|
88
|
+
warning.
|
|
89
|
+
- This closes the `@SkipRealm()` follow-up for requests with no realm. A
|
|
90
|
+
decorator cannot work, because middleware runs before Nest resolves the
|
|
91
|
+
handler.
|
|
92
|
+
- **`oauthController: false`** on `AuthModule.forRootAsync`, beside `useFactory`,
|
|
93
|
+
leaves `OAuthController` unmounted, so both routes answer 404 like any unknown
|
|
94
|
+
path. Defaults to `true`. Requested by Ambush Desk.
|
|
95
|
+
- `OAuthProviderNotConfiguredException` (404, `OAUTH_PROVIDER_NOT_CONFIGURED`),
|
|
96
|
+
thrown by the no-op strategies.
|
|
97
|
+
- `AuthService.realmsEnabled`.
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
- **Realm-scoped entry points refuse a request without a realm.** With realms
|
|
101
|
+
enabled, `BaseAuthResolver` flows (through `getRealmFromContext`) and the OAuth
|
|
102
|
+
routes answer `400 Realm required` when the request has no realm, instead of
|
|
103
|
+
running with `realm` undefined, which many repositories read as "any realm".
|
|
104
|
+
Before `realm.skip` the middleware ruled this out over HTTP; now it also
|
|
105
|
+
contains a `skip` predicate that matches more than intended. Code that calls
|
|
106
|
+
`perform*` methods without the GraphQL context gets the 400 too when realms are
|
|
107
|
+
enabled.
|
|
108
|
+
- **The OAuth routes' IP rate-limit keys include the realm**
|
|
109
|
+
(`auth:ipRate:<realm>:<ipHash>`, as for `login`), so existing counts for those
|
|
110
|
+
routes start again after upgrading.
|
|
111
|
+
- With `['api-key']` alone, an unknown key's 401 now carries the guard's generic
|
|
112
|
+
`Unauthorized` message instead of `Invalid API key`. That also stops confirming
|
|
113
|
+
to the caller that the token was checked as an API key.
|
|
114
|
+
- `JwtAuthGuard` reads the request through `getRequestFromContext`, as
|
|
115
|
+
`createAuthGuard` does, instead of through `GqlExecutionContext`. There is no
|
|
116
|
+
behaviour change: the old lookup also returned the HTTP request on HTTP routes,
|
|
117
|
+
checked on NestJS 10 and 11.
|
|
118
|
+
|
|
119
|
+
### Documentation
|
|
120
|
+
- README: routes without a realm, `oauthController`, the OAuth routes' error
|
|
121
|
+
table, guard order for API keys and JWTs, a **Module Options** table, NestJS 10
|
|
122
|
+
and 11 support, and **Migrating to v0.10.0**. The OAuth section no longer calls
|
|
123
|
+
the routes callback routes; they exchange tokens.
|
|
124
|
+
- `IRefreshTokenRepository` documents that entities returned by
|
|
125
|
+
`findByHashedToken` must carry `id`, `userId` and `createdAt`, and that refresh
|
|
126
|
+
measures expiry from `createdAt`. `create` is not given `createdAt`, so a store
|
|
127
|
+
with no default for it fails on refresh. Found by the new end-to-end suite.
|
|
128
|
+
|
|
129
|
+
### Testing
|
|
130
|
+
- **CI runs on NestJS 11.** A `test:nest11` job runs the build, unit tests and
|
|
131
|
+
end-to-end suite on NestJS 11, `@nestjs/graphql` 13, Apollo Server 5 and
|
|
132
|
+
Express 5, beside the NestJS 10 job. Run locally before release: 982 unit tests
|
|
133
|
+
and 29 end-to-end tests pass on NestJS 11.2.5, `@nestjs/graphql` 13.4.5, Apollo
|
|
134
|
+
Server 5.5.1 and Express 5.2.1, with no source change for NestJS 11. On Express,
|
|
135
|
+
`@nestjs/apollo` 13 also needs `@as-integrations/express5`. Requested by Ambush
|
|
136
|
+
Desk.
|
|
137
|
+
- **An end-to-end suite** (`npm run test:e2e`, in `test/e2e`) boots a real HTTP
|
|
138
|
+
and GraphQL (Apollo) application against the built package, with in-memory
|
|
139
|
+
repositories. It covers:
|
|
140
|
+
- realm skipping and rejection
|
|
141
|
+
- the OAuth routes mounted, unmounted, and failing with each status above
|
|
142
|
+
- `createAuthGuard` with API keys and JWTs in both orders, on HTTP and in a
|
|
143
|
+
resolver
|
|
144
|
+
- `JwtAuthGuard` on HTTP
|
|
145
|
+
- login and refresh through a `BaseAuthResolver` subclass
|
|
146
|
+
|
|
147
|
+
Each fix above was checked by reintroducing the defect and watching a unit or
|
|
148
|
+
end-to-end test fail.
|
|
149
|
+
|
|
150
|
+
## [0.9.1] - 2026-09-14
|
|
151
|
+
|
|
152
|
+
Documentation only — no code changes. npm shows the README of the latest
|
|
153
|
+
published version, so these corrections needed a release to reach the package
|
|
154
|
+
page.
|
|
155
|
+
|
|
156
|
+
### Documentation
|
|
157
|
+
- **README: account-status enforcement was undocumented.** 0.9.0 made suspension and deletion revoke access — `ACCOUNT_INACTIVE` (HTTP 403) at login, on refresh and on every authenticated request — and added the `isUserActive` option, but the README mentioned none of it, including in **Migrating to v0.9.0**. Adds an **Account Status** section, an `isUserActive` row under **Common Options**, a **Security Features** entry, and a migration item: clients need to handle `ACCOUNT_INACTIVE`, and repositories must stop hiding inactive users.
|
|
158
|
+
- **README: JWT Validation Modes** now says `'full'` rejects inactive accounts on the next request, and that in `'payload-only'` a suspended user keeps working until their access token expires while refresh stays blocked.
|
|
159
|
+
- **README: Utilities** lists the helpers 0.9.0 exported: `isUserActiveByDefault`, `emailForLog`, `ipForLog`, `maskPhoneDigits`, `redactSecurityEventMetadata` and `hashIp`.
|
|
160
|
+
- **README: Migrating to v0.9.0** no longer says code mode is entirely unchanged. With no base URL at all, code-mode emails now carry no page link.
|
|
161
|
+
- **CHANGELOG: the 0.9.0 release note** said the `rc.4` and `rc.5` changes had not been run on an adopter's staging. Lift had deployed `rc.5` to staging; the note is corrected in place.
|
|
162
|
+
|
|
30
163
|
## [0.9.0] - 2026-09-14
|
|
31
164
|
|
|
32
165
|
Three independent workstreams land here: a trim of the email interface surface
|
|
@@ -43,12 +176,15 @@ phone numbers — see **Security**.
|
|
|
43
176
|
> Shipped through five release candidates on the `next` dist-tag before
|
|
44
177
|
> reaching `latest`; this release is the content of `0.9.0-rc.5` under its
|
|
45
178
|
> final version. Ariadne verified token and code mode end to end before
|
|
46
|
-
> `rc.1
|
|
47
|
-
>
|
|
48
|
-
>
|
|
49
|
-
>
|
|
50
|
-
>
|
|
51
|
-
>
|
|
179
|
+
> `rc.1`. Lift ran its automated staging checks and its real-inbox, phone and
|
|
180
|
+
> Google sign-in checks against `rc.3`, then deployed `rc.5` to staging: 18/18
|
|
181
|
+
> automated auth checks, a clean boot, no code-mode base URL warning, and no
|
|
182
|
+
> raw email, IP address or phone number in the package's log output. `rc.2`
|
|
183
|
+
> carried eight stale compiled files; see **Fixed (release tooling)**.
|
|
184
|
+
>
|
|
185
|
+
> *Corrected in 0.9.1. As published in 0.9.0, this note said the `rc.4` and
|
|
186
|
+
> `rc.5` changes had not been run on an adopter's staging; Lift's `rc.5`
|
|
187
|
+
> staging run had been recorded minutes before the note was written.*
|
|
52
188
|
|
|
53
189
|
### ⚠ External configuration required
|
|
54
190
|
- **`verificationMode: 'token'` requires your frontend to serve two routes.**
|
package/README.md
CHANGED
|
@@ -19,10 +19,12 @@ Production-grade authentication module for NestJS GraphQL + REST APIs. JWT, cook
|
|
|
19
19
|
- [Brute Force Protection](#brute-force-protection)
|
|
20
20
|
- [Password Policy](#password-policy)
|
|
21
21
|
- [Lifecycle Hooks](#lifecycle-hooks)
|
|
22
|
+
- [Account Status](#account-status)
|
|
22
23
|
- [JWT Validation Modes](#jwt-validation-modes)
|
|
23
24
|
- [JWT Payload Factory](#jwt-payload-factory)
|
|
24
25
|
- [Configuration Reference](#configuration-reference)
|
|
25
26
|
- [Required Options](#required-options)
|
|
27
|
+
- [Module Options](#module-options-forrootasync)
|
|
26
28
|
- [Common Options](#common-options)
|
|
27
29
|
- [Feature Flags](#feature-flags-features)
|
|
28
30
|
- [Security Secrets](#security-secrets)
|
|
@@ -35,6 +37,7 @@ Production-grade authentication module for NestJS GraphQL + REST APIs. JWT, cook
|
|
|
35
37
|
- [Guards](#guards)
|
|
36
38
|
- [Utilities](#utilities)
|
|
37
39
|
- [Security Features](#security-features)
|
|
40
|
+
- [Migrating to v0.10.0](#migrating-to-v0100)
|
|
38
41
|
- [Migrating to v0.9.0](#migrating-to-v090)
|
|
39
42
|
- [License](#license)
|
|
40
43
|
|
|
@@ -64,6 +67,8 @@ npm install @nestjs/common @nestjs/core @nestjs/graphql @nestjs/jwt @nestjs/pass
|
|
|
64
67
|
|
|
65
68
|
`resend` is an optional peer dependency -- install it only if using the Resend email sender.
|
|
66
69
|
|
|
70
|
+
Supports NestJS 10 and NestJS 11. CI runs the unit and end-to-end suites on both: NestJS 10 with `@nestjs/graphql` 12, Express 4 and Apollo Server 4, and NestJS 11 with `@nestjs/graphql` 13, Express 5 and Apollo Server 5.
|
|
71
|
+
|
|
67
72
|
## Quick Start
|
|
68
73
|
|
|
69
74
|
Minimal setup: JWT authentication with email/password login.
|
|
@@ -468,6 +473,29 @@ AuthModule.forRootAsync({
|
|
|
468
473
|
|
|
469
474
|
`RealmMiddleware` is automatically registered by `AuthModule` — no manual middleware registration needed. When a `realmExtractorInstance` is provided, the middleware calls `extractor.extractRealm(request)` on every request before any guards run. If the extractor returns `null`, the request is rejected with `400 Bad Request` (strict mode).
|
|
470
475
|
|
|
476
|
+
**Routes without a realm.** Health checks, inbound webhooks and public downloads have no realm by nature. Match them with `realm.skip`, and the middleware lets them through without calling the extractor:
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
AuthModule.forRootAsync({
|
|
480
|
+
// ...
|
|
481
|
+
useFactory: (usersRepo, tokenRepo, realmExtractor, config) => ({
|
|
482
|
+
// ...required options
|
|
483
|
+
realmExtractorInstance: realmExtractor,
|
|
484
|
+
realm: {
|
|
485
|
+
skip: (path) => path === '/health' || path.startsWith('/hooks/'),
|
|
486
|
+
},
|
|
487
|
+
}),
|
|
488
|
+
})
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
- `path` is the path the client requested, including any global prefix and without the query string. Match on it, not on `request.path` or `request.url`: Express rewrites both to `/` inside middleware. The request itself is the second argument.
|
|
492
|
+
- A skipped request has no realm: `request._realm` stays undefined.
|
|
493
|
+
- **Skip only routes that are unauthenticated or authenticate by other means.** A JWT's realm claim cannot match a request with no realm, so `JwtStrategy` answers 401. `BaseAuthResolver` flows and the OAuth routes answer `400 Realm required` rather than run outside a realm, which also contains a predicate that matches more than you meant.
|
|
494
|
+
- `skip` must return a boolean synchronously. If it throws or returns anything else, such as the Promise from an `async` function, the request is not skipped and the error is logged.
|
|
495
|
+
- Without `realmExtractorInstance`, `realm.skip` is ignored and a warning is logged at boot. A `realm.skip` that is not a function fails boot with `InvalidAuthConfigException`.
|
|
496
|
+
|
|
497
|
+
Why a predicate rather than route patterns: the same Nest route pattern matches different paths on NestJS 10 and NestJS 11 — `hooks/*` excludes `/hooks/glitchtip/issue` on 11 but not on 10 — so a pattern list would behave differently depending on your Nest version. A `@SkipRealm()` decorator cannot work either, because middleware runs before Nest resolves the route handler.
|
|
498
|
+
|
|
471
499
|
**Use `@CurrentRealm()` in resolvers:**
|
|
472
500
|
|
|
473
501
|
```typescript
|
|
@@ -524,7 +552,9 @@ Then use a multi-strategy guard:
|
|
|
524
552
|
{ provide: APP_GUARD, useClass: createAuthGuard(['api-key', 'jwt'], { allowPublic: true }) }
|
|
525
553
|
```
|
|
526
554
|
|
|
527
|
-
The `ApiKeyStrategy` hashes the bearer token with SHA-256 and calls `findByKeyHash()` on your repository. API keys and
|
|
555
|
+
The `ApiKeyStrategy` hashes the bearer token with SHA-256 and calls `findByKeyHash()` on your repository. API keys and JWTs share the `Authorization: Bearer` header, and strategies are tried in the order listed. A request with no bearer token, or with one that matches no key, falls through to the next strategy, so `['api-key', 'jwt']` and `['jwt', 'api-key']` both accept either credential. A key that matches an inactive account is rejected with 401 and no other strategy runs. When every strategy fails, the guard answers 401.
|
|
556
|
+
|
|
557
|
+
Before 0.10.0 the API key strategy rejected an unknown bearer token itself, which stopped the chain: `['api-key', 'jwt']` rejected every JWT.
|
|
528
558
|
|
|
529
559
|
### Email System
|
|
530
560
|
|
|
@@ -694,7 +724,33 @@ AuthModule.forRootAsync({
|
|
|
694
724
|
})
|
|
695
725
|
```
|
|
696
726
|
|
|
697
|
-
|
|
727
|
+
`OAuthController` mounts two token-exchange routes for native mobile sign-in: `POST /auth/google/token` with body `{ "idToken": "..." }`, and `POST /auth/facebook/token` with body `{ "accessToken": "..." }`. Both return `{ accessToken, refreshToken, user }`.
|
|
728
|
+
|
|
729
|
+
**Not using them?** Leave them unmounted, and they answer 404 like any unknown path:
|
|
730
|
+
|
|
731
|
+
```typescript
|
|
732
|
+
AuthModule.forRootAsync({
|
|
733
|
+
oauthController: false, // beside useFactory, not inside it
|
|
734
|
+
useFactory: () => ({ /* ... */ }),
|
|
735
|
+
})
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
It sits beside `useFactory` because Nest fixes a module's controllers before async options resolve. GraphQL account linking does not use these routes and keeps working.
|
|
739
|
+
|
|
740
|
+
**Errors.** The routes answer with an HTTP status and a body carrying `message`, `code` and `statusCode` at the root, plus the fields listed:
|
|
741
|
+
|
|
742
|
+
| Status | `code` | When | Other fields |
|
|
743
|
+
|--------|--------|------|--------------|
|
|
744
|
+
| 404 | `OAUTH_PROVIDER_NOT_CONFIGURED` | The provider has no credentials in this deployment | `provider` |
|
|
745
|
+
| 401 | `INVALID_OAUTH_TOKEN` | The provider rejected the token | `provider` |
|
|
746
|
+
| 400 | `OAUTH_MISSING_DATA` | The provider returned no email, or an unverified one | `provider`, `missingField`; for a new Facebook user, `fallbackToken` and `providerId` |
|
|
747
|
+
| 409 | `EMAIL_EXISTS_WITH_PASSWORD` | The email belongs to a password account | `email`, `linkingToken` |
|
|
748
|
+
| 409 | `OAUTH_ACCOUNT_ALREADY_LINKED` | The account has a different ID linked for this provider | `provider` |
|
|
749
|
+
| 403 | `ACCOUNT_LOCKED` | Brute-force lockout | `remainingLockoutTime` (seconds) |
|
|
750
|
+
| 403 | `ACCOUNT_INACTIVE` | The account is suspended or deleted | -- |
|
|
751
|
+
| 429 | `RATE_LIMIT_EXCEEDED` | The client IP exceeded `bruteForce.ipRateLimit` | -- |
|
|
752
|
+
|
|
753
|
+
With realms enabled, a request without a realm gets `400 Realm required` first. Before 0.10.0 the lockout, inactive-account, rate-limit and unconfigured-provider cases answered 500.
|
|
698
754
|
|
|
699
755
|
### Brute Force Protection
|
|
700
756
|
|
|
@@ -847,10 +903,33 @@ All hooks are optional. Async hooks are awaited but failures are logged and do n
|
|
|
847
903
|
|
|
848
904
|
`onAccountLocked` fires from `BruteForceProtectionService.recordFailedAttempt` on the transition from "not locked" → "locked". Subsequent failed attempts while the account remains locked do **not** re-fire (use `onAuthFailure` for per-attempt signal). Wire it to send the account-locked email yourself — the package no longer ships a `sendAccountLockedEmail` method on `IEmailService`; notification surface area beyond verification, password-reset, and password-changed is consumer-owned via this hook.
|
|
849
905
|
|
|
906
|
+
### Account Status
|
|
907
|
+
|
|
908
|
+
Suspending or deleting a user takes effect on their next request. The package checks each user's `status` and `deletedAt` itself:
|
|
909
|
+
|
|
910
|
+
| Where | Effect |
|
|
911
|
+
|-------|--------|
|
|
912
|
+
| `login` | Rejected after the password is verified, so the check cannot reveal to someone without the password that an address is suspended |
|
|
913
|
+
| Every authenticated request (`jwtValidation: 'full'`) | Rejected on the next request, not at token expiry |
|
|
914
|
+
| `refreshToken` | Rejected, including within the refresh grace period |
|
|
915
|
+
| Any token issuance | Rejected, as a backstop for every flow that mints tokens |
|
|
916
|
+
|
|
917
|
+
A rejected request throws `AccountInactiveException`: a GraphQL error with `extensions.code` `ACCOUNT_INACTIVE`, `statusCode` `403`, and the message `This account is no longer active.` It does not say whether the account was suspended or deleted. Unlike `AccountLockedException` it does not clear on its own, so clients should sign the user out rather than offer a retry. Each rejection logs `SecurityEvent.ACCOUNT_INACTIVE_BLOCKED` with a `phase` of `login`, `refresh`, `session` or `issue`.
|
|
918
|
+
|
|
919
|
+
**Which accounts are inactive.** By default (`isUserActiveByDefault`), a user with `deletedAt` set, or whose `status` is `SUSPENDED` or `DELETED`, compared case-insensitively. Any other status — including one the package does not recognise — counts as active, so a status vocabulary that differs from `UserStatus` cannot lock everyone out. If yours differs, supply a predicate:
|
|
920
|
+
|
|
921
|
+
```typescript
|
|
922
|
+
isUserActive: (user) => user.status !== 'FROZEN' && user.status !== 'CLOSED' && !user.deletedAt,
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
It must be synchronous and pure: it runs on every authenticated request, against the user already loaded.
|
|
926
|
+
|
|
927
|
+
**Your repository must return inactive users.** `findById` and `findByEmail` should return suspended and soft-deleted users like any other. A repository that hides them turns `ACCOUNT_INACTIVE` into a "not found" failure, and the package can no longer tell the client why.
|
|
928
|
+
|
|
850
929
|
### JWT Validation Modes
|
|
851
930
|
|
|
852
|
-
- **`'full'`** (default) -- Calls `userRepository.findById()` on every request
|
|
853
|
-
- **`'payload-only'`** -- Returns `{ id, email }` from the JWT payload without a DB lookup. Faster, but
|
|
931
|
+
- **`'full'`** (default) -- Calls `userRepository.findById()` on every request, rejecting the request if the user no longer exists or is no longer active (see [Account Status](#account-status)).
|
|
932
|
+
- **`'payload-only'`** -- Returns `{ id, email }` from the JWT payload without a DB lookup. Faster, but nothing about the account is re-checked per request: a suspended or deleted user keeps working until their access token expires (`jwtExpiresIn`, 15 minutes by default). Refresh is still blocked, so one access-token lifetime is the whole window.
|
|
854
933
|
|
|
855
934
|
```typescript
|
|
856
935
|
jwtValidation: 'payload-only',
|
|
@@ -883,6 +962,17 @@ jwtPayloadFactoryInstance: {
|
|
|
883
962
|
| `refreshTokenRepositoryInstance` | `IRefreshTokenRepository` | Token persistence |
|
|
884
963
|
| `jwtSecret` | `string` | JWT signing secret |
|
|
885
964
|
|
|
965
|
+
### Module Options (`forRootAsync`)
|
|
966
|
+
|
|
967
|
+
These sit beside `useFactory`, not in the object it returns.
|
|
968
|
+
|
|
969
|
+
| Option | Type | Default | Description |
|
|
970
|
+
|--------|------|---------|-------------|
|
|
971
|
+
| `useFactory` | `(...deps) => AuthModuleOptions` | -- | Returns the options in the other tables. Required |
|
|
972
|
+
| `inject` | `any[]` | `[]` | Providers passed to `useFactory` |
|
|
973
|
+
| `imports` | `any[]` | `[]` | Modules that export those providers |
|
|
974
|
+
| `oauthController` | `boolean` | `true` | Mount the REST OAuth token routes. See [OAuth](#oauth) |
|
|
975
|
+
|
|
886
976
|
### Common Options
|
|
887
977
|
|
|
888
978
|
| Option | Type | Default | Description |
|
|
@@ -890,11 +980,13 @@ jwtPayloadFactoryInstance: {
|
|
|
890
980
|
| `jwtExpiresIn` | `string` | `'15m'` | Access token TTL |
|
|
891
981
|
| `refreshTokenExpiresIn` | `string` | `'30d'` | Refresh token TTL |
|
|
892
982
|
| `jwtValidation` | `'full' \| 'payload-only'` | `'full'` | JWT validation strategy |
|
|
983
|
+
| `isUserActive` | `(user) => boolean` | `isUserActiveByDefault` | Decides whether an account may authenticate. See [Account Status](#account-status) |
|
|
893
984
|
| `bcryptRounds` | `number` | `12` | Password hashing cost |
|
|
894
985
|
| `nodeEnv` | `string` | `'production'` | Environment identifier |
|
|
895
986
|
| `passwordPolicy` | `PasswordPolicyConfig` | See [Password Policy](#password-policy) | Password strength rules |
|
|
896
987
|
| `encryptionKey` | `string` | -- | 32-byte hex string for AES-256-GCM (OAuth token encryption) |
|
|
897
988
|
| `bruteForce.ipRateLimit` | `{ maxAttempts, windowMs }` | -- | IP rate-limit policy for `checkIpRateLimit`. When set, `rateLimiterInstance` MUST also be provided explicitly (boot fails with `InvalidAuthConfigException` otherwise). See [IP Rate Limiting](#ip-rate-limiting). |
|
|
989
|
+
| `realm.skip` | `(path, request) => boolean` | -- | Requests that need no realm, such as health checks and webhooks. Read only with `realmExtractorInstance`. See [Realm-Based Identity Isolation](#realm-based-identity-isolation) |
|
|
898
990
|
|
|
899
991
|
### Feature Flags (`features`)
|
|
900
992
|
|
|
@@ -1012,7 +1104,7 @@ When `email` is provided, it takes precedence over `emailServiceInstance`.
|
|
|
1012
1104
|
| `CsrfGuard` | CSRF header validation for cookie auth |
|
|
1013
1105
|
| `TenantGuard` | Multi-tenant context resolution |
|
|
1014
1106
|
| `PermissionGuard` | Permission checking against tenant context |
|
|
1015
|
-
| `JwtAuthGuard` |
|
|
1107
|
+
| `JwtAuthGuard` | JWT-only guard for GraphQL and HTTP routes (prefer `createAuthGuard` for several strategies or `@Public()`) |
|
|
1016
1108
|
|
|
1017
1109
|
### Recommended Guard Chains
|
|
1018
1110
|
|
|
@@ -1034,12 +1126,17 @@ When realm support is enabled, `RealmMiddleware` runs before all guards (as Nest
|
|
|
1034
1126
|
|
|
1035
1127
|
## Utilities
|
|
1036
1128
|
|
|
1037
|
-
Helper functions exported for use in custom guards and
|
|
1129
|
+
Helper functions exported for use in custom guards, middleware and loggers:
|
|
1038
1130
|
|
|
1039
1131
|
| Function | Description |
|
|
1040
1132
|
|----------|-------------|
|
|
1041
1133
|
| `getRequestFromContext(context)` | Extract request from `ExecutionContext` (handles GraphQL + HTTP) |
|
|
1042
1134
|
| `extractIpAddress(request)` | Extract client IP (checks `clientIp`, `req.ip`, falls back to `'unknown'`) |
|
|
1135
|
+
| `isUserActiveByDefault(user)` | The default account-active predicate (see [Account Status](#account-status)) |
|
|
1136
|
+
| `emailForLog(email)`, `ipForLog(ip)` | An email or IP as it may appear in a log line — `emailHash=…` / `ipHash=…`, salted like the package's own logs |
|
|
1137
|
+
| `maskPhoneDigits(phone)` | Masks every digit but the last two, keeping formatting |
|
|
1138
|
+
| `redactSecurityEventMetadata(metadata)` | Security-event metadata with email, IP and phone fields hashed or masked — what `ConsoleAuthLogger` prints. Call it from a custom `IAuthLogger` for the same treatment |
|
|
1139
|
+
| `hashIp(ip, salt)` | HMAC-SHA256 IP hash (16 hex characters) used for rate-limit keys |
|
|
1043
1140
|
|
|
1044
1141
|
```typescript
|
|
1045
1142
|
import { getRequestFromContext, extractIpAddress } from '@ambushsoftworks/nestjs-auth-graphql';
|
|
@@ -1059,17 +1156,39 @@ export class CustomGuard implements CanActivate {
|
|
|
1059
1156
|
|
|
1060
1157
|
- **Refresh token rotation** with HMAC-SHA256 hashing and idempotent 10-second grace period
|
|
1061
1158
|
- **Bcrypt password hashing** with configurable rounds (default: 12)
|
|
1159
|
+
- **Account status enforcement** -- suspended and deleted users are rejected at login, on refresh and on every authenticated request (`ACCOUNT_INACTIVE`)
|
|
1062
1160
|
- **AES-256-GCM encryption** for OAuth tokens at rest
|
|
1063
1161
|
- **Constant-time comparison** for verification codes
|
|
1064
1162
|
- **Account enumeration prevention** on signup (optional)
|
|
1065
1163
|
- **Stateless CSRF protection** for OAuth flows via `OAuthStateService`
|
|
1066
1164
|
- **`__Host-` cookie prefix** support for enhanced cookie security
|
|
1067
1165
|
- **Separate HMAC secrets** for refresh tokens, verification codes, and OAuth state
|
|
1068
|
-
- **Realm-based identity isolation** with JWT realm claim validation
|
|
1166
|
+
- **Realm-based identity isolation** with JWT realm claim validation, realm-scoped rate limiting and lockout, and auth flows that refuse a request without a realm
|
|
1069
1167
|
- **No raw personal data in package logs** — log lines use the user ID or a salted hash (`emailHash=`, `ipHash=`, under `AUTH_IP_HASH_SALT` or `jwtSecret`), phone numbers keep only their last two digits, and the default `ConsoleAuthLogger` redacts security-event metadata. A custom `authLoggerInstance` receives the raw fields; pass them through `redactSecurityEventMetadata` to store them redacted.
|
|
1070
1168
|
|
|
1169
|
+
## Migrating to v0.10.0
|
|
1170
|
+
|
|
1171
|
+
No code change is required. Check the items that apply to you.
|
|
1172
|
+
|
|
1173
|
+
**Clients of the OAuth REST routes.** Four failures that answered 500 now answer 404, 403 or 429 with a `code`; see the table under [OAuth](#oauth). A client that shows a generic error for any failure keeps working. One that branched on 500, or on the old message `Account is locked. Please try again in N minutes.`, should read `code` instead. The lockout message is now the one `login` uses.
|
|
1174
|
+
|
|
1175
|
+
**API key guards.** `createAuthGuard(['api-key', 'jwt'])` now accepts JWTs. With `['api-key']` alone, an unknown key still gets 401, now with the guard's generic `Unauthorized` message rather than `Invalid API key`.
|
|
1176
|
+
|
|
1177
|
+
**Realms.** With realms enabled, a `BaseAuthResolver` flow or OAuth route reached by a request without a realm answers `400 Realm required`. Before `realm.skip`, `RealmMiddleware` made that impossible, so in practice this affects only code calling `perform*` methods without the GraphQL context, which now counts as having no realm. The OAuth routes also pass the realm to lockout checks, IP rate limiting and the failed-attempt reset. Their IP rate-limit counters move to the realm-prefixed keys `login` already uses (`auth:ipRate:<realm>:<ipHash>`), so existing counts for those routes start again.
|
|
1178
|
+
|
|
1179
|
+
**NestJS 11.** The package needs no change to run on it; CI now tests both majors.
|
|
1180
|
+
|
|
1071
1181
|
## Migrating to v0.9.0
|
|
1072
1182
|
|
|
1183
|
+
**Behaviour change — suspended and deleted accounts are rejected.** Before
|
|
1184
|
+
0.9.0 the package never checked `status` or `deletedAt`, so suspending a user
|
|
1185
|
+
revoked nothing unless your repository happened to hide them. Now those users
|
|
1186
|
+
get `ACCOUNT_INACTIVE` (HTTP 403) at login, on refresh and on their next
|
|
1187
|
+
request. Handle that error in your clients by signing the user out, check that
|
|
1188
|
+
your status values are recognised (supply `isUserActive` if not), and stop
|
|
1189
|
+
filtering inactive users out of `findById` / `findByEmail`. See
|
|
1190
|
+
[Account Status](#account-status).
|
|
1191
|
+
|
|
1073
1192
|
**Changed — log output no longer contains raw personal data.** If you parse
|
|
1074
1193
|
`ConsoleAuthLogger` output or the package's log lines, expect `emailHash` /
|
|
1075
1194
|
`ipHash` in place of `email` / `ipAddress`, masked phone numbers, and user IDs
|
|
@@ -1123,8 +1242,13 @@ Three things to check, in the order they are most likely to bite:
|
|
|
1123
1242
|
Token TTL also differs from code TTL: 60 minutes by default
|
|
1124
1243
|
(`verification.tokenExpiresInMinutes`) versus 15 for codes.
|
|
1125
1244
|
|
|
1126
|
-
**`verificationMode: 'code'` — the default — is unaffected
|
|
1127
|
-
|
|
1245
|
+
**`verificationMode: 'code'` — the default — is unaffected by the token-mode
|
|
1246
|
+
fix**, including the legacy `FRONTEND_URL` fallback for the page link. One
|
|
1247
|
+
change applies to code mode separately: with neither `verification.baseUrl` nor
|
|
1248
|
+
`FRONTEND_URL` set, code-mode emails now carry no page link, where they used to
|
|
1249
|
+
carry an `https://app.example.com` placeholder that never resolved. The bundled
|
|
1250
|
+
email service never showed that link in code mode; only a custom `IEmailService`
|
|
1251
|
+
that rendered it notices.
|
|
1128
1252
|
|
|
1129
1253
|
**`bcrypt` 5 → 6.** No code change and no hash migration: existing hashes
|
|
1130
1254
|
verify unchanged, and hashes written by 0.9.0 still verify if you roll back to
|
package/dist/auth.module.d.ts
CHANGED
|
@@ -49,6 +49,9 @@ export interface AuthModuleOptions {
|
|
|
49
49
|
tenantRepositoryInstance?: ITenantRepository;
|
|
50
50
|
tenantExtractorInstance?: ITenantExtractor;
|
|
51
51
|
realmExtractorInstance?: IRealmExtractor;
|
|
52
|
+
realm?: {
|
|
53
|
+
skip?: (path: string, request: Record<string, any>) => boolean;
|
|
54
|
+
};
|
|
52
55
|
resourcePermissionRepositoryInstance?: IResourcePermissionRepository;
|
|
53
56
|
jwtPayloadFactoryInstance?: IJwtPayloadFactory;
|
|
54
57
|
apiKeyRepositoryInstance?: IApiKeyRepository;
|
|
@@ -119,9 +122,11 @@ export interface AuthModuleOptions {
|
|
|
119
122
|
export interface AuthModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
120
123
|
useFactory: (...args: any[]) => Promise<AuthModuleOptions> | AuthModuleOptions;
|
|
121
124
|
inject?: any[];
|
|
125
|
+
oauthController?: boolean;
|
|
122
126
|
}
|
|
123
127
|
export declare function validateAuthModuleOptions(opts: AuthModuleOptions): void;
|
|
124
128
|
export declare function describeIgnoredFeatureFlags(opts: AuthModuleOptions): string[];
|
|
129
|
+
export declare function describeIgnoredOptions(opts: AuthModuleOptions): string[];
|
|
125
130
|
export { AUTH_MODULE_OPTIONS, USER_REPOSITORY, REFRESH_TOKEN_REPOSITORY, EMAIL_SERVICE, SMS_SERVICE, AUTH_LIFECYCLE_HOOKS, VERIFICATION_REPOSITORY, BRUTE_FORCE_REPOSITORY, BIOMETRIC_REPOSITORY, AUTH_LOGGER, RATE_LIMITER, TENANT_REPOSITORY, TENANT_EXTRACTOR, RESOURCE_PERMISSION_REPOSITORY, JWT_PAYLOAD_FACTORY, API_KEY_REPOSITORY, } from './constants';
|
|
126
131
|
export declare class AuthModule implements NestModule {
|
|
127
132
|
configure(consumer: MiddlewareConsumer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAElB,UAAU,EAGX,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA0B3D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAYjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,O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,EAAE,OAAO,CAAC;CAC3B;AA2BD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAsCvE;AA2ED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAwB7E;AASD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAYxE;AA+ED,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAuCrB,qBACa,UAAW,YAAW,UAAU;IAC3C,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAkC7C,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa;CA8YpE"}
|
package/dist/auth.module.js
CHANGED
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.AuthModule = exports.API_KEY_REPOSITORY = exports.JWT_PAYLOAD_FACTORY = exports.RESOURCE_PERMISSION_REPOSITORY = exports.TENANT_EXTRACTOR = exports.TENANT_REPOSITORY = exports.RATE_LIMITER = exports.AUTH_LOGGER = exports.BIOMETRIC_REPOSITORY = exports.BRUTE_FORCE_REPOSITORY = exports.VERIFICATION_REPOSITORY = exports.AUTH_LIFECYCLE_HOOKS = exports.SMS_SERVICE = exports.EMAIL_SERVICE = exports.REFRESH_TOKEN_REPOSITORY = exports.USER_REPOSITORY = exports.AUTH_MODULE_OPTIONS = void 0;
|
|
11
11
|
exports.validateAuthModuleOptions = validateAuthModuleOptions;
|
|
12
12
|
exports.describeIgnoredFeatureFlags = describeIgnoredFeatureFlags;
|
|
13
|
+
exports.describeIgnoredOptions = describeIgnoredOptions;
|
|
13
14
|
const common_1 = require("@nestjs/common");
|
|
14
15
|
const realm_middleware_1 = require("./middleware/realm.middleware");
|
|
15
16
|
const jwt_1 = require("@nestjs/jwt");
|
|
@@ -47,6 +48,7 @@ const configurable_email_service_1 = require("./services/configurable-email.serv
|
|
|
47
48
|
const default_email_template_renderer_1 = require("./services/default-email-template-renderer");
|
|
48
49
|
function validateAuthModuleOptions(opts) {
|
|
49
50
|
validateVerificationOptions(opts);
|
|
51
|
+
validateRealmOptions(opts);
|
|
50
52
|
const ipRateLimit = opts.bruteForce?.ipRateLimit;
|
|
51
53
|
if (ipRateLimit && !opts.rateLimiterInstance) {
|
|
52
54
|
throw new invalid_auth_config_exception_1.InvalidAuthConfigException('[AuthModule] bruteForce.ipRateLimit is configured but rateLimiterInstance ' +
|
|
@@ -125,6 +127,24 @@ function describeIgnoredFeatureFlags(opts) {
|
|
|
125
127
|
`${removed.controlledBy}. In this configuration, ${state}. Remove the key.`);
|
|
126
128
|
});
|
|
127
129
|
}
|
|
130
|
+
function describeIgnoredOptions(opts) {
|
|
131
|
+
const messages = describeIgnoredFeatureFlags(opts);
|
|
132
|
+
if (opts.realm?.skip !== undefined && !opts.realmExtractorInstance) {
|
|
133
|
+
messages.push('[AuthModule] realm.skip is ignored: realms are enabled by `realmExtractorInstance`, ' +
|
|
134
|
+
'which is not set, so no request is asked for a realm and none needs skipping. ' +
|
|
135
|
+
'Remove realm.skip, or set realmExtractorInstance.');
|
|
136
|
+
}
|
|
137
|
+
return messages;
|
|
138
|
+
}
|
|
139
|
+
function validateRealmOptions(opts) {
|
|
140
|
+
const skip = opts.realm?.skip;
|
|
141
|
+
if (!opts.realmExtractorInstance || skip === undefined || typeof skip === 'function') {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
throw new invalid_auth_config_exception_1.InvalidAuthConfigException(`[AuthModule] realm.skip must be a function (path, request) => boolean; received ${Array.isArray(skip) ? 'an array' : typeof skip}. Route patterns are not accepted because Nest matches them differently on ` +
|
|
145
|
+
"NestJS 10 and 11. Match the path instead, e.g. skip: (path) => path === '/health' " +
|
|
146
|
+
"|| path.startsWith('/hooks/').");
|
|
147
|
+
}
|
|
128
148
|
function validateVerificationOptions(opts) {
|
|
129
149
|
if ((opts.features?.verificationMode ?? 'code') !== 'token') {
|
|
130
150
|
return;
|
|
@@ -179,7 +199,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
179
199
|
useFactory: async (...args) => {
|
|
180
200
|
const opts = await options.useFactory(...args);
|
|
181
201
|
validateAuthModuleOptions(opts);
|
|
182
|
-
for (const warning of
|
|
202
|
+
for (const warning of describeIgnoredOptions(opts)) {
|
|
183
203
|
common_1.Logger.warn(warning, 'AuthModule');
|
|
184
204
|
}
|
|
185
205
|
(0, personal_data_1.setPersonalDataLogSalt)(process.env.AUTH_IP_HASH_SALT || opts.jwtSecret);
|
|
@@ -217,7 +237,7 @@ let AuthModule = AuthModule_1 = class AuthModule {
|
|
|
217
237
|
}),
|
|
218
238
|
}),
|
|
219
239
|
],
|
|
220
|
-
controllers: [oauth_controller_1.OAuthController],
|
|
240
|
+
controllers: options.oauthController === false ? [] : [oauth_controller_1.OAuthController],
|
|
221
241
|
providers: [
|
|
222
242
|
optionsProvider,
|
|
223
243
|
{
|
package/dist/auth.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../src/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAuoBA,8DAqCC;AA2ED,kEAwBC;AA/wBD,2CAOwB;AACxB,oEAAgE;AAChE,qCAAwC;AACxC,+CAAkD;AAIlD,0DAAsD;AACtD,4EAAuE;AACvE,0EAAsE;AACtE,sEAAkE;AAClE,wEAAmE;AACnE,8FAAwF;AAExF,8EAAyE;AAEzE,8FAAyF;AACzF,wFAAkF;AAGlF,4DAAwD;AACxD,kEAA8D;AAC9D,sEAAkE;AAClE,4EAAuE;AACv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3B,6CAAoB;gBAEpB,6DAA4B;gBAC5B,sDAAwB;gBACxB,uBAAW;gBACX,2BAAe;gBACf,oCAAwB;gBACxB,6BAAiB;gBACjB,4BAAgB;gBAChB,2BAAe;gBACf,0CAA8B;gBAC9B,+BAAmB;gBACnB,8BAAkB;gBAClB,0BAAW;gBACX,kCAAe;gBACf,eAAS;gBACT,yBAAc;aACf;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAjbY,gCAAU;qBAAV,UAAU;IADtB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,UAAU,CAibtB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { UnauthorizedException, BadRequestException, ConflictException } from '@nestjs/common';
|
|
1
|
+
import { UnauthorizedException, BadRequestException, ConflictException, NotFoundException } from '@nestjs/common';
|
|
2
|
+
export declare class OAuthProviderNotConfiguredException extends NotFoundException {
|
|
3
|
+
constructor(provider: 'google' | 'facebook');
|
|
4
|
+
}
|
|
2
5
|
export declare class OAuthStateMismatchException extends UnauthorizedException {
|
|
3
6
|
constructor();
|
|
4
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.exceptions.d.ts","sourceRoot":"","sources":["../../src/exceptions/oauth.exceptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"oauth.exceptions.d.ts","sourceRoot":"","sources":["../../src/exceptions/oauth.exceptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AAQxB,qBAAa,mCAAoC,SAAQ,iBAAiB;gBAC5D,QAAQ,EAAE,QAAQ,GAAG,UAAU;CAQ5C;AAMD,qBAAa,2BAA4B,SAAQ,qBAAqB;;CAQrE;AAMD,qBAAa,sBAAuB,SAAQ,mBAAmB;gBACjD,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAQ5C;AAMD,qBAAa,2BAA4B,SAAQ,iBAAiB;gBACpD,QAAQ,EAAE,MAAM;CAQ7B;AAMD,qBAAa,2BAA4B,SAAQ,iBAAiB;gBACpD,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAUhD;AASD,qBAAa,yBAA0B,SAAQ,mBAAmB;gBAE9D,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE,MAAM,EACtB,UAAU,CAAC,EAAE,MAAM;CAYtB;AAMD,qBAAa,0BAA2B,SAAQ,qBAAqB;gBACvD,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAQ9C;AAOD,qBAAa,mCAAoC,SAAQ,qBAAqB;;CAQ7E"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CannotUnlinkLastAuthMethodException = exports.InvalidOAuthTokenException = exports.OAuthMissingDataException = exports.EmailAlreadyExistsException = exports.OAuthAccountLinkedException = exports.OAuthProviderException = exports.OAuthStateMismatchException = void 0;
|
|
3
|
+
exports.CannotUnlinkLastAuthMethodException = exports.InvalidOAuthTokenException = exports.OAuthMissingDataException = exports.EmailAlreadyExistsException = exports.OAuthAccountLinkedException = exports.OAuthProviderException = exports.OAuthStateMismatchException = exports.OAuthProviderNotConfiguredException = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
|
+
class OAuthProviderNotConfiguredException extends common_1.NotFoundException {
|
|
6
|
+
constructor(provider) {
|
|
7
|
+
super({
|
|
8
|
+
message: `${provider === 'google' ? 'Google' : 'Facebook'} sign-in is not configured.`,
|
|
9
|
+
code: 'OAUTH_PROVIDER_NOT_CONFIGURED',
|
|
10
|
+
provider,
|
|
11
|
+
statusCode: common_1.HttpStatus.NOT_FOUND,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.OAuthProviderNotConfiguredException = OAuthProviderNotConfiguredException;
|
|
5
16
|
class OAuthStateMismatchException extends common_1.UnauthorizedException {
|
|
6
17
|
constructor() {
|
|
7
18
|
super({
|