@skyapp-labs/blueprint-backend-core 1.8.1 → 1.9.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 +29 -3
- package/dist/modules/auth/controllers/auth.controller.d.ts +2 -2
- package/dist/modules/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/auth.controller.js +52 -12
- package/dist/modules/auth/controllers/auth.controller.js.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js +3 -1
- package/dist/modules/auth/controllers/forgot-password.controller.js.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/otp.controller.js +44 -35
- package/dist/modules/auth/controllers/otp.controller.js.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/pin.controller.js +17 -8
- package/dist/modules/auth/controllers/pin.controller.js.map +1 -1
- package/dist/modules/auth/controllers/session.controller.d.ts.map +1 -1
- package/dist/modules/auth/controllers/session.controller.js +1 -3
- package/dist/modules/auth/controllers/session.controller.js.map +1 -1
- package/dist/modules/auth/dto/index.d.ts +0 -1
- package/dist/modules/auth/dto/index.d.ts.map +1 -1
- package/dist/modules/auth/dto/index.js +0 -1
- package/dist/modules/auth/dto/index.js.map +1 -1
- package/dist/modules/auth/dto/login.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/login.dto.js +11 -3
- package/dist/modules/auth/dto/login.dto.js.map +1 -1
- package/dist/modules/auth/dto/otp.dto.d.ts +22 -0
- package/dist/modules/auth/dto/otp.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/otp.dto.js +93 -4
- package/dist/modules/auth/dto/otp.dto.js.map +1 -1
- package/dist/modules/auth/dto/password.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/password.dto.js +3 -2
- package/dist/modules/auth/dto/password.dto.js.map +1 -1
- package/dist/modules/auth/dto/register.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/register.dto.js +9 -3
- package/dist/modules/auth/dto/register.dto.js.map +1 -1
- package/dist/modules/auth/dto/token.dto.d.ts +5 -0
- package/dist/modules/auth/dto/token.dto.d.ts.map +1 -1
- package/dist/modules/auth/dto/token.dto.js +25 -2
- package/dist/modules/auth/dto/token.dto.js.map +1 -1
- package/dist/modules/sessions/services/token.service.d.ts.map +1 -1
- package/dist/modules/sessions/services/token.service.js +8 -3
- package/dist/modules/sessions/services/token.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/modules/auth/dto/forgot-password.dto.d.ts +0 -12
- package/dist/modules/auth/dto/forgot-password.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/forgot-password.dto.js +0 -45
- package/dist/modules/auth/dto/forgot-password.dto.js.map +0 -1
- package/dist/modules/auth/dto/invite.dto.d.ts +0 -7
- package/dist/modules/auth/dto/invite.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/invite.dto.js +0 -39
- package/dist/modules/auth/dto/invite.dto.js.map +0 -1
- package/dist/modules/auth/dto/login-email.dto.d.ts +0 -5
- package/dist/modules/auth/dto/login-email.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/login-email.dto.js +0 -26
- package/dist/modules/auth/dto/login-email.dto.js.map +0 -1
- package/dist/modules/auth/dto/login-phone.dto.d.ts +0 -7
- package/dist/modules/auth/dto/login-phone.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/login-phone.dto.js +0 -39
- package/dist/modules/auth/dto/login-phone.dto.js.map +0 -1
- package/dist/modules/auth/dto/refresh-token.dto.d.ts +0 -4
- package/dist/modules/auth/dto/refresh-token.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/refresh-token.dto.js +0 -21
- package/dist/modules/auth/dto/refresh-token.dto.js.map +0 -1
- package/dist/modules/auth/dto/register-email.dto.d.ts +0 -7
- package/dist/modules/auth/dto/register-email.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/register-email.dto.js +0 -34
- package/dist/modules/auth/dto/register-email.dto.js.map +0 -1
- package/dist/modules/auth/dto/register-phone.dto.d.ts +0 -9
- package/dist/modules/auth/dto/register-phone.dto.d.ts.map +0 -1
- package/dist/modules/auth/dto/register-phone.dto.js +0 -46
- package/dist/modules/auth/dto/register-phone.dto.js.map +0 -1
- package/dist/modules/otp/dto/send-otp.dto.d.ts +0 -11
- package/dist/modules/otp/dto/send-otp.dto.d.ts.map +0 -1
- package/dist/modules/otp/dto/send-otp.dto.js +0 -39
- package/dist/modules/otp/dto/send-otp.dto.js.map +0 -1
- package/dist/modules/otp/dto/verify-email.dto.d.ts +0 -5
- package/dist/modules/otp/dto/verify-email.dto.d.ts.map +0 -1
- package/dist/modules/otp/dto/verify-email.dto.js +0 -27
- package/dist/modules/otp/dto/verify-email.dto.js.map +0 -1
- package/dist/modules/otp/dto/verify-otp.dto.d.ts +0 -5
- package/dist/modules/otp/dto/verify-otp.dto.d.ts.map +0 -1
- package/dist/modules/otp/dto/verify-otp.dto.js +0 -28
- package/dist/modules/otp/dto/verify-otp.dto.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# [1.9.0](https://github.com/Skyapp-Labs/blueprint-backend-core/compare/v1.8.1...v1.9.0) (2026-06-23)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* enhance authentication and OTP flow documentation ([01e5188](https://github.com/Skyapp-Labs/blueprint-backend-core/commit/01e5188a4915f6ab046d18303fd7107eab3f5aba))
|
|
7
7
|
|
|
8
8
|
# Changelog
|
|
9
9
|
|
|
@@ -13,6 +13,32 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## [1.8.2] - 2026-06-23
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **PIN validation** — wired `ConfigAwareValidationPipe` on all PIN body endpoints (`set`, `change`, `verify`, `remove`) so `@IsConfiguredPinLength()` reads the runtime `pin.length` setting instead of the hardcoded default.
|
|
21
|
+
- **Signup/register tokens** — clearer errors when `verifyPhoneVerifiedToken()` fails: **409** when an existing account’s login token is sent to `/auth/register`, and **401** guidance when `verificationId` is used instead of `verificationToken` or the token is expired/reused.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Swagger documentation** — updated auth, OTP, PIN, session, and password controllers with step-by-step phone/email flows, request examples, and typed response schemas (`TokenResponseDto`, `OtpVerifyResponseDto`, etc.).
|
|
26
|
+
|
|
27
|
+
### Removed
|
|
28
|
+
|
|
29
|
+
- **Unused DTOs** — removed duplicate/legacy files: `login-phone`, `login-email`, `register-phone`, `register-email`, `refresh-token`, `forgot-password`, `invite`, and legacy `otp/dto/*` stubs superseded by `auth/dto/otp.dto.ts`.
|
|
30
|
+
|
|
31
|
+
## [1.8.1] - 2026-06-22
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **PIN verify/change/remove** — fixed `loadPinRecord()` using `.addSelect('pin.pinHash')` instead of the DB column name `pin.pin_hash`, which left `record.pinHash` undefined and caused argon2 to throw `pchstr must be a non-empty string` on verify.
|
|
36
|
+
- **PIN hash guard** — return a clear 400 when a PIN row exists but has no stored hash, instead of a 500 from argon2.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- **PIN status responses** — `GET /auth/pin/status` and `GET /auth/pin/status/:type` now include a `length` field reflecting the configured `pin.length` setting so clients know how many digits to collect.
|
|
41
|
+
|
|
16
42
|
## [1.8.0] - 2026-06-19
|
|
17
43
|
|
|
18
44
|
### Fixed
|
|
@@ -13,7 +13,7 @@ export declare class AuthController {
|
|
|
13
13
|
authMethod: "email" | "phone";
|
|
14
14
|
passwordResetEnabled: boolean;
|
|
15
15
|
};
|
|
16
|
-
login(body: LoginDto, req: Request): Promise<import("
|
|
17
|
-
register(body: RegisterDto, req: Request): Promise<import("
|
|
16
|
+
login(body: LoginDto, req: Request): Promise<import("../dto/token.dto").TokenResponse>;
|
|
17
|
+
register(body: RegisterDto, req: Request): Promise<import("../dto/token.dto").TokenResponse>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=auth.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAG3E,qBAGa,cAAc;IAEzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe;IAkBlD,SAAS;;;;IAuCT,KAAK,CAAkC,IAAI,EAAE,QAAQ,EAAS,GAAG,EAAE,OAAO;IA8C1E,QAAQ,CAAkC,IAAI,EAAE,WAAW,EAAS,GAAG,EAAE,OAAO;CAIhF"}
|
|
@@ -22,6 +22,7 @@ const login_service_1 = require("../services/login.service");
|
|
|
22
22
|
const registration_service_1 = require("../services/registration.service");
|
|
23
23
|
const login_dto_1 = require("../dto/login.dto");
|
|
24
24
|
const register_dto_1 = require("../dto/register.dto");
|
|
25
|
+
const token_dto_1 = require("../dto/token.dto");
|
|
25
26
|
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
26
27
|
const settings_service_1 = require("../../settings/services/settings.service");
|
|
27
28
|
const settings_keys_1 = require("../../settings/constants/settings.keys");
|
|
@@ -53,7 +54,7 @@ __decorate([
|
|
|
53
54
|
(0, swagger_1.ApiOperation)({
|
|
54
55
|
summary: 'Auth configuration',
|
|
55
56
|
description: 'Returns the active authentication configuration. ' +
|
|
56
|
-
'
|
|
57
|
+
'Call on app startup to determine which login/registration UI to present.',
|
|
57
58
|
}),
|
|
58
59
|
(0, swagger_1.ApiOkResponse)({
|
|
59
60
|
schema: {
|
|
@@ -73,13 +74,26 @@ __decorate([
|
|
|
73
74
|
(0, common_1.UseGuards)(guards_1.LoginIpRateLimitGuard),
|
|
74
75
|
(0, swagger_1.ApiOperation)({
|
|
75
76
|
summary: 'Login',
|
|
76
|
-
description: '
|
|
77
|
+
description: '**Phone auth (auth.method=phone):** complete OTP first, then send `{ verificationToken }` from verify-otp when hasAccount=true.\n\n' +
|
|
78
|
+
'**Email auth (auth.method=email):** send `{ email, password }`.',
|
|
77
79
|
}),
|
|
78
|
-
(0, swagger_1.ApiBody)({
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
(0, swagger_1.ApiBody)({
|
|
81
|
+
type: login_dto_1.LoginDto,
|
|
82
|
+
examples: {
|
|
83
|
+
phone: {
|
|
84
|
+
summary: 'Phone OTP login (hasAccount=true)',
|
|
85
|
+
value: { verificationToken: 'c498758c-eec1-4a3b-b496-a6eddf498d4c' },
|
|
86
|
+
},
|
|
87
|
+
email: {
|
|
88
|
+
summary: 'Email + password login',
|
|
89
|
+
value: { email: 'user@example.com', password: 'P@ssw0rd!' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
93
|
+
(0, swagger_1.ApiOkResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
94
|
+
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
95
|
+
description: 'Invalid or expired verificationToken (phone), or invalid credentials (email)',
|
|
81
96
|
}),
|
|
82
|
-
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid or expired temporary token' }),
|
|
83
97
|
(0, swagger_1.ApiTooManyRequestsResponse)({
|
|
84
98
|
description: 'Too many login attempts from this IP or identifier is locked',
|
|
85
99
|
}),
|
|
@@ -94,14 +108,40 @@ __decorate([
|
|
|
94
108
|
(0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
|
|
95
109
|
(0, swagger_1.ApiOperation)({
|
|
96
110
|
summary: 'Register new account',
|
|
97
|
-
description: '
|
|
111
|
+
description: '**Phone auth flow:**\n' +
|
|
112
|
+
'1. POST /auth/send-otp → `verificationId`\n' +
|
|
113
|
+
'2. POST /auth/verify-otp → `verificationToken` (when hasAccount=false)\n' +
|
|
114
|
+
'3. POST /auth/register → `{ verificationToken, profile }`\n\n' +
|
|
115
|
+
'Use **verificationToken** from step 2 — not verificationId. Token is single-use and expires per tokens.temporary_ttl_seconds.\n\n' +
|
|
116
|
+
'**Email auth:** send `{ email, password, profile }` — no OTP token required.',
|
|
117
|
+
}),
|
|
118
|
+
(0, swagger_1.ApiBody)({
|
|
119
|
+
type: register_dto_1.RegisterDto,
|
|
120
|
+
examples: {
|
|
121
|
+
phone: {
|
|
122
|
+
summary: 'Phone signup (after verify-otp, hasAccount=false)',
|
|
123
|
+
value: {
|
|
124
|
+
verificationToken: 'c498758c-eec1-4a3b-b496-a6eddf498d4c',
|
|
125
|
+
profile: { firstName: 'Ada', lastName: 'Lovelace' },
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
email: {
|
|
129
|
+
summary: 'Email + password signup',
|
|
130
|
+
value: {
|
|
131
|
+
email: 'new.user@example.com',
|
|
132
|
+
password: 'P@ssw0rd!',
|
|
133
|
+
profile: { firstName: 'Ada', lastName: 'Lovelace' },
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
}),
|
|
138
|
+
(0, swagger_1.ApiCreatedResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
139
|
+
(0, swagger_1.ApiConflictResponse)({
|
|
140
|
+
description: 'Phone or email already registered, or verificationToken belongs to an existing account (use /auth/login instead)',
|
|
98
141
|
}),
|
|
99
|
-
(0, swagger_1.
|
|
100
|
-
|
|
101
|
-
schema: { example: { accessToken: 'jwt', refreshToken: 'id.secret', expiresIn: 900000 } },
|
|
142
|
+
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
143
|
+
description: 'Invalid, expired, or already-used verificationToken. Use verificationToken from verify-otp (hasAccount=false), not verificationId.',
|
|
102
144
|
}),
|
|
103
|
-
(0, swagger_1.ApiConflictResponse)({ description: 'Phone number or email already registered' }),
|
|
104
|
-
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid or expired phone-verified token' }),
|
|
105
145
|
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
106
146
|
__param(1, (0, common_1.Req)()),
|
|
107
147
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmG;AACnG,6CASyB;AAEzB,2DAAoD;AACpD,uEAAyE;AACzE,mDAA+D;AAC/D,6DAAyD;AACzD,2EAAuE;AACvE,gDAA4C;AAC5C,sDAAkD;AAClD,qGAA+F;AAC/F,+EAA2E;AAC3E,0EAAsE;AAK/D,IAAM,cAAc,GAApB,MAAM,cAAc;IAC1B,YACkB,YAA0B,EAC1B,mBAAwC,EACxC,eAAgC;QAFhC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,oBAAe,GAAf,eAAe,CAAiB;IAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmG;AACnG,6CASyB;AAEzB,2DAAoD;AACpD,uEAAyE;AACzE,mDAA+D;AAC/D,6DAAyD;AACzD,2EAAuE;AACvE,gDAA4C;AAC5C,sDAAkD;AAClD,gDAAoD;AACpD,qGAA+F;AAC/F,+EAA2E;AAC3E,0EAAsE;AAK/D,IAAM,cAAc,GAApB,MAAM,cAAc;IAC1B,YACkB,YAA0B,EAC1B,mBAAwC,EACxC,eAAgC;QAFhC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,oBAAe,GAAf,eAAe,CAAiB;IAC/C,CAAC;IAiBJ,SAAS;QACR,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAS,4BAAY,CAAC,WAAW,CAElE,CAAC;QACX,OAAO;YACN,UAAU;YACV,oBAAoB,EAAE,UAAU,KAAK,OAAO;SAC5C,CAAC;IACH,CAAC;IA+BD,KAAK,CAAkC,IAAc,EAAS,GAAY;QACzE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,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AAnB,0BAAW;;8CAG1D;yBA9GW,cAAc;IAH1B,IAAA,iBAAO,EAAC,MAAM,CAAC;IACf,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,mBAAM,GAAE;qCAGwB,4BAAY;QACL,0CAAmB;QACvB,kCAAe;GAJtC,cAAc,CA+G1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,qBAGa,wBAAwB;IACxB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAe7D,cAAc,CAAS,IAAI,EAAE,iBAAiB;;;IAa9C,aAAa,CAAS,IAAI,EAAE,gBAAgB,EAAS,GAAG,EAAE,OAAO;;;
|
|
1
|
+
{"version":3,"file":"forgot-password.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACN,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,qBAGa,wBAAwB;IACxB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAe7D,cAAc,CAAS,IAAI,EAAE,iBAAiB;;;IAa9C,aAAa,CAAS,IAAI,EAAE,gBAAgB,EAAS,GAAG,EAAE,OAAO;;;IAkBjE,sBAAsB,CAAS,IAAI,EAAE,yBAAyB,EAAS,GAAG,EAAE,OAAO;;;CAInF"}
|
|
@@ -79,7 +79,9 @@ __decorate([
|
|
|
79
79
|
}),
|
|
80
80
|
(0, swagger_1.ApiBody)({ type: password_dto_1.ResetPasswordWithPhoneDto }),
|
|
81
81
|
(0, swagger_1.ApiOkResponse)({ schema: { example: { message: 'Password reset successfully.' } } }),
|
|
82
|
-
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
82
|
+
(0, swagger_1.ApiUnauthorizedResponse)({
|
|
83
|
+
description: 'Invalid or expired verificationToken, or token belongs to an existing account (use /auth/login)',
|
|
84
|
+
}),
|
|
83
85
|
__param(0, (0, common_1.Body)()),
|
|
84
86
|
__param(1, (0, common_1.Req)()),
|
|
85
87
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmF;AACnF,6CAMyB;AAEzB,2DAAoD;AACpD,uEAAyE;AACzE,mEAA+D;AAC/D,sDAI6B;AAKtB,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACpC,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAejE,cAAc,CAAS,IAAuB;QAC7C,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAWD,aAAa,CAAS,IAAsB,EAAS,GAAY;QAChE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;
|
|
1
|
+
{"version":3,"file":"forgot-password.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/forgot-password.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAA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controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"otp.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/otp.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EAIZ,MAAM,gBAAgB,CAAC;AAExB,qBAGa,aAAa;IACb,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IA2C3D,OAAO,CAAkC,IAAI,EAAE,UAAU;IAwDzD,SAAS,CAAkC,IAAI,EAAE,YAAY;IAmB7D,SAAS,CAAkC,IAAI,EAAE,YAAY;CAG7D"}
|
|
@@ -43,17 +43,19 @@ __decorate([
|
|
|
43
43
|
(0, common_1.UseGuards)(guards_1.OtpIpRateLimitGuard),
|
|
44
44
|
(0, swagger_1.ApiOperation)({
|
|
45
45
|
summary: 'Send OTP',
|
|
46
|
-
description: 'Generates an OTP
|
|
46
|
+
description: 'Step 1 of phone/email verification. Generates an OTP (length from otp.code_length setting, 4–6 digits), ' +
|
|
47
|
+
'delivers it via SMS or email, and returns a **verificationId** for verify-otp/resend-otp. ' +
|
|
48
|
+
'Test identifiers in test.otp_identifiers use a fixed code in non-production environments.',
|
|
47
49
|
}),
|
|
48
50
|
(0, swagger_1.ApiBody)({
|
|
49
51
|
type: otp_dto_1.SendOtpDto,
|
|
50
52
|
examples: {
|
|
51
53
|
sms_default: {
|
|
52
|
-
summary: 'Send via SMS (default when
|
|
54
|
+
summary: 'Send via SMS (default when auth.method=phone)',
|
|
53
55
|
value: { phone: '+2348012345678' },
|
|
54
56
|
},
|
|
55
57
|
email_default: {
|
|
56
|
-
summary: 'Send via email (default when
|
|
58
|
+
summary: 'Send via email (default when auth.method=email)',
|
|
57
59
|
value: { email: 'user@example.com' },
|
|
58
60
|
},
|
|
59
61
|
sms_override: {
|
|
@@ -66,15 +68,7 @@ __decorate([
|
|
|
66
68
|
},
|
|
67
69
|
},
|
|
68
70
|
}),
|
|
69
|
-
(0, swagger_1.ApiOkResponse)({
|
|
70
|
-
schema: {
|
|
71
|
-
example: {
|
|
72
|
-
success: true,
|
|
73
|
-
message: 'OTP generated successfully',
|
|
74
|
-
data: { verificationId: 'uuid-v4', expiresAt: 1700000300000, resendIn: 60000 },
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
}),
|
|
71
|
+
(0, swagger_1.ApiOkResponse)({ type: otp_dto_1.OtpGenerateResponseDto }),
|
|
78
72
|
(0, swagger_1.ApiBadRequestResponse)({
|
|
79
73
|
description: 'Invalid phone number or email format, or missing identifier for chosen channel',
|
|
80
74
|
}),
|
|
@@ -93,20 +87,42 @@ __decorate([
|
|
|
93
87
|
(0, common_1.UseGuards)(guards_1.OtpIpRateLimitGuard),
|
|
94
88
|
(0, swagger_1.ApiOperation)({
|
|
95
89
|
summary: 'Verify OTP',
|
|
96
|
-
description: '
|
|
90
|
+
description: 'Step 2 of phone/email verification. Submit the **verificationId** from send-otp/resend-otp and the OTP code.\n\n' +
|
|
91
|
+
'Returns a **verificationToken** for the next step:\n' +
|
|
92
|
+
'- `hasAccount: true` → POST /auth/login\n' +
|
|
93
|
+
'- `hasAccount: false` → POST /auth/register (phone auth)\n\n' +
|
|
94
|
+
'Do not confuse verificationId (input) with verificationToken (output).',
|
|
97
95
|
}),
|
|
98
96
|
(0, swagger_1.ApiBody)({ type: otp_dto_1.VerifyOtpDto }),
|
|
99
97
|
(0, swagger_1.ApiOkResponse)({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
type: otp_dto_1.OtpVerifyResponseDto,
|
|
99
|
+
examples: {
|
|
100
|
+
existing_user: {
|
|
101
|
+
summary: 'Existing account — proceed to login',
|
|
102
|
+
value: {
|
|
103
|
+
success: true,
|
|
104
|
+
message: 'OTP verified successfully',
|
|
105
|
+
data: {
|
|
106
|
+
subject: '+2348012345678',
|
|
107
|
+
channel: 'sms',
|
|
108
|
+
verificationToken: 'e860bc81-245b-470b-9fac-a484cf93f457',
|
|
109
|
+
expiresAt: 1782245811728,
|
|
110
|
+
hasAccount: true,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
new_user: {
|
|
115
|
+
summary: 'New user — proceed to register',
|
|
116
|
+
value: {
|
|
117
|
+
success: true,
|
|
118
|
+
message: 'OTP verified successfully',
|
|
119
|
+
data: {
|
|
120
|
+
subject: '+2349023456789',
|
|
121
|
+
channel: 'sms',
|
|
122
|
+
verificationToken: 'c498758c-eec1-4a3b-b496-a6eddf498d4c',
|
|
123
|
+
expiresAt: 1782245803859,
|
|
124
|
+
hasAccount: false,
|
|
125
|
+
},
|
|
110
126
|
},
|
|
111
127
|
},
|
|
112
128
|
},
|
|
@@ -126,21 +142,14 @@ __decorate([
|
|
|
126
142
|
(0, common_1.UseGuards)(guards_1.OtpIpRateLimitGuard),
|
|
127
143
|
(0, swagger_1.ApiOperation)({
|
|
128
144
|
summary: 'Resend OTP',
|
|
129
|
-
description: 'Invalidates the current session and sends a new
|
|
145
|
+
description: 'Invalidates the current OTP session and sends a new code. Returns a new **verificationId**. ' +
|
|
146
|
+
'Subject to otp.resend_cooldown_seconds between resends.',
|
|
130
147
|
}),
|
|
131
148
|
(0, swagger_1.ApiBody)({ type: otp_dto_1.ResendOtpDto }),
|
|
132
|
-
(0, swagger_1.ApiOkResponse)({
|
|
133
|
-
|
|
134
|
-
example: {
|
|
135
|
-
success: true,
|
|
136
|
-
message: 'OTP generated successfully',
|
|
137
|
-
data: { verificationId: 'new-uuid-v4', expiresAt: 1700000300000, resendIn: 60000 },
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
}),
|
|
141
|
-
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid or expired session token' }),
|
|
149
|
+
(0, swagger_1.ApiOkResponse)({ type: otp_dto_1.OtpGenerateResponseDto }),
|
|
150
|
+
(0, swagger_1.ApiBadRequestResponse)({ description: 'Invalid or expired verificationId' }),
|
|
142
151
|
(0, swagger_1.ApiTooManyRequestsResponse)({
|
|
143
|
-
description: 'Resend cooldown active —
|
|
152
|
+
description: 'Resend cooldown active — wait before requesting another code',
|
|
144
153
|
}),
|
|
145
154
|
__param(0, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
146
155
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/otp.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CAQyB;AACzB,2DAAoD;AACpD,mDAA6D;AAC7D,qGAA+F;AAC/F,mEAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"otp.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/otp.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAyF;AACzF,6CAQyB;AACzB,2DAAoD;AACpD,mDAA6D;AAC7D,qGAA+F;AAC/F,mEAA8D;AAC9D,4CAOwB;AAKjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACzB,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IA2C/D,OAAO,CAAkC,IAAgB;QACxD,MAAM,OAAO,GAAG,IAAA,wBAAc,EAAC,IAAI,CAAC,CAAC;QACrC,MAAM,UAAU,GAAG,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAM,CAAC;QACjE,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC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EAAE,kEAAkE;KAC/E,CAAC;IACD,IAAA,oCAA0B,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;IAC3D,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;;qCAAO,sBAAY;;8CAE5D;AAiBD;IAfC,IAAA,aAAI,EAAC,YAAY,CAAC;IAClB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IACvB,IAAA,kBAAS,EAAC,4BAAmB,CAAC;IAC9B,IAAA,sBAAY,EAAC;QACb,OAAO,EAAE,YAAY;QACrB,WAAW,EACV,8FAA8F;YAC9F,yDAAyD;KAC1D,CAAC;IACD,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,sBAAY,EAAE,CAAC;IAC/B,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,gCAAsB,EAAE,CAAC;IAC/C,IAAA,+BAAqB,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IAC3E,IAAA,oCAA0B,EAAC;QAC3B,WAAW,EAAE,8DAA8D;KAC3E,CAAC;IACS,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;;qCAAO,sBAAY;;8CAE5D;wBAzHW,aAAa;IAHzB,IAAA,iBAAO,EAAC,MAAM,CAAC;IACf,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,mBAAM,GAAE;qCAEqC,iCAAc;GAD/C,aAAa,CA0HzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/pin.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pin.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/pin.controller.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnG,qBAIa,aAAa;IACb,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IA4B3D,SAAS,CAAgB,IAAI,EAAE,IAAI;IA+BnC,gBAAgB,CAAgB,IAAI,EAAE,IAAI,EAAiB,IAAI,EAAE,MAAM;IAsBvE,MAAM,CAAgB,IAAI,EAAE,IAAI,EAAmC,GAAG,EAAE,SAAS;;;IAoBjF,SAAS,CAAgB,IAAI,EAAE,IAAI,EAAmC,GAAG,EAAE,YAAY;;;IAyBvF,SAAS,CAAgB,IAAI,EAAE,IAAI,EAAmC,GAAG,EAAE,YAAY;;;IAsBvF,SAAS,CAAgB,IAAI,EAAE,IAAI,EAAmC,GAAG,EAAE,YAAY;;;CAGvF"}
|
|
@@ -17,6 +17,7 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const swagger_1 = require("@nestjs/swagger");
|
|
18
18
|
const auth_guard_1 = require("../../../common/guards/auth.guard");
|
|
19
19
|
const decorators_1 = require("../../../common/decorators");
|
|
20
|
+
const config_aware_validation_pipe_1 = require("../../../common/pipes/config-aware-validation.pipe");
|
|
20
21
|
const user_entity_1 = require("../../users/entities/user.entity");
|
|
21
22
|
const pin_auth_service_1 = require("../services/pin-auth.service");
|
|
22
23
|
const pin_dto_1 = require("../dto/pin.dto");
|
|
@@ -119,9 +120,11 @@ __decorate([
|
|
|
119
120
|
schema: { example: { message: 'authentication PIN set successfully.' } },
|
|
120
121
|
}),
|
|
121
122
|
(0, swagger_1.ApiConflictResponse)({ description: 'A PIN for this type is already set' }),
|
|
122
|
-
(0, swagger_1.ApiBadRequestResponse)({
|
|
123
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
124
|
+
description: 'Invalid PIN type, or PIN length does not match pin.length setting',
|
|
125
|
+
}),
|
|
123
126
|
__param(0, (0, decorators_1.CurrentUser)()),
|
|
124
|
-
__param(1, (0, common_1.Body)()),
|
|
127
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
125
128
|
__metadata("design:type", Function),
|
|
126
129
|
__metadata("design:paramtypes", [user_entity_1.User, pin_dto_1.SetPinDto]),
|
|
127
130
|
__metadata("design:returntype", void 0)
|
|
@@ -138,9 +141,11 @@ __decorate([
|
|
|
138
141
|
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Current PIN is incorrect' }),
|
|
139
142
|
(0, swagger_1.ApiForbiddenResponse)({ description: 'PIN is locked due to too many failed attempts' }),
|
|
140
143
|
(0, swagger_1.ApiNotFoundResponse)({ description: 'No PIN found for this type — use /auth/pin/set first' }),
|
|
141
|
-
(0, swagger_1.ApiBadRequestResponse)({
|
|
144
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
145
|
+
description: 'Invalid PIN type, or PIN length does not match pin.length setting',
|
|
146
|
+
}),
|
|
142
147
|
__param(0, (0, decorators_1.CurrentUser)()),
|
|
143
|
-
__param(1, (0, common_1.Body)()),
|
|
148
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
144
149
|
__metadata("design:type", Function),
|
|
145
150
|
__metadata("design:paramtypes", [user_entity_1.User, pin_dto_1.ChangePinDto]),
|
|
146
151
|
__metadata("design:returntype", void 0)
|
|
@@ -161,9 +166,11 @@ __decorate([
|
|
|
161
166
|
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Incorrect PIN' }),
|
|
162
167
|
(0, swagger_1.ApiForbiddenResponse)({ description: 'PIN is locked — too many wrong attempts' }),
|
|
163
168
|
(0, swagger_1.ApiNotFoundResponse)({ description: 'No PIN found for this type' }),
|
|
164
|
-
(0, swagger_1.ApiBadRequestResponse)({
|
|
169
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
170
|
+
description: 'Invalid PIN type, or PIN length does not match pin.length setting',
|
|
171
|
+
}),
|
|
165
172
|
__param(0, (0, decorators_1.CurrentUser)()),
|
|
166
|
-
__param(1, (0, common_1.Body)()),
|
|
173
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
167
174
|
__metadata("design:type", Function),
|
|
168
175
|
__metadata("design:paramtypes", [user_entity_1.User, pin_dto_1.VerifyPinDto]),
|
|
169
176
|
__metadata("design:returntype", void 0)
|
|
@@ -181,9 +188,11 @@ __decorate([
|
|
|
181
188
|
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Current PIN is incorrect' }),
|
|
182
189
|
(0, swagger_1.ApiForbiddenResponse)({ description: 'PIN is locked' }),
|
|
183
190
|
(0, swagger_1.ApiNotFoundResponse)({ description: 'No PIN found for this type' }),
|
|
184
|
-
(0, swagger_1.ApiBadRequestResponse)({
|
|
191
|
+
(0, swagger_1.ApiBadRequestResponse)({
|
|
192
|
+
description: 'Invalid PIN type, or PIN length does not match pin.length setting',
|
|
193
|
+
}),
|
|
185
194
|
__param(0, (0, decorators_1.CurrentUser)()),
|
|
186
|
-
__param(1, (0, common_1.Body)()),
|
|
195
|
+
__param(1, (0, common_1.Body)(config_aware_validation_pipe_1.ConfigAwareValidationPipe)),
|
|
187
196
|
__metadata("design:type", Function),
|
|
188
197
|
__metadata("design:paramtypes", [user_entity_1.User, pin_dto_1.RemovePinDto]),
|
|
189
198
|
__metadata("design:returntype", void 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/pin.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAayB;AACzB,kEAAiE;AACjE,2DAAyD;AACzD,kEAAwD;AACxD,mEAA8D;AAC9D,4CAAmG;AAM5F,IAAM,aAAa,GAAnB,MAAM,aAAa;IACzB,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IA4B/D,SAAS,CAAgB,IAAU;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IA6BD,gBAAgB,CAAgB,IAAU,EAAiB,IAAY;QACtE,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;
|
|
1
|
+
{"version":3,"file":"pin.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/pin.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAayB;AACzB,kEAAiE;AACjE,2DAAyD;AACzD,qGAA+F;AAC/F,kEAAwD;AACxD,mEAA8D;AAC9D,4CAAmG;AAM5F,IAAM,aAAa,GAAnB,MAAM,aAAa;IACzB,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IA4B/D,SAAS,CAAgB,IAAU;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IA6BD,gBAAgB,CAAgB,IAAU,EAAiB,IAAY;QACtE,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC;IAoBD,MAAM,CAAgB,IAAU,EAAmC,GAAc;QAChF,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjD,CAAC;IAkBD,SAAS,CAAgB,IAAU,EAAmC,GAAiB;QACtF,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;IAuBD,SAAS,CAAgB,IAAU,EAAmC,GAAiB;QACtF,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAA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,EAAC,QAAQ,CAAC;IAChB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IACvB,IAAA,sBAAY,EAAC;QACb,OAAO,EAAE,cAAc;QACvB,WAAW,EACV,kFAAkF;YAClF,4EAA4E;KAC7E,CAAC;IACD,IAAA,iBAAO,EAAC,EAAE,IAAI,EAAE,sBAAY,EAAE,CAAC;IAC/B,IAAA,uBAAa,EAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,EAAE,EAAE,CAAC;IAC/F,IAAA,iCAAuB,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IACpE,IAAA,8BAAoB,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IACtD,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IAClE,IAAA,+BAAqB,EAAC;QACtB,WAAW,EAAE,mEAAmE;KAChF,CAAC;IACS,WAAA,IAAA,wBAAW,GAAE,CAAA;IAAc,WAAA,IAAA,aAAI,EAAC,wDAAyB,CAAC,CAAA;;qCAAtC,kBAAI,EAAwC,sBAAY;;8CAEtF;wBAvJW,aAAa;IAJzB,IAAA,iBAAO,EAAC,KAAK,CAAC;IACd,IAAA,mBAAU,EAAC,UAAU,CAAC;IACtB,IAAA,kBAAS,EAAC,yBAAY,CAAC;IACvB,IAAA,uBAAa,GAAE;qCAE8B,iCAAc;GAD/C,aAAa,CAwJzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/session.controller.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"session.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/session.controller.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAoB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,qBAIa,iBAAiB;IAE5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY;IAc5C,YAAY,CAAS,IAAI,EAAE,eAAe,EAAS,GAAG,EAAE,OAAO;IAY/D,MAAM,CAAgB,IAAI,EAAE,IAAI;;;IAShC,iBAAiB,CAAgB,IAAI,EAAE,IAAI;IAW3C,aAAa,CAAoC,SAAS,EAAE,MAAM,EAAiB,IAAI,EAAE,IAAI;;;CAG7F"}
|
|
@@ -54,9 +54,7 @@ __decorate([
|
|
|
54
54
|
description: 'Rotate refresh token and get a new access + refresh token pair.',
|
|
55
55
|
}),
|
|
56
56
|
(0, swagger_1.ApiBody)({ type: token_dto_1.RefreshTokenDto }),
|
|
57
|
-
(0, swagger_1.ApiOkResponse)({
|
|
58
|
-
schema: { example: { accessToken: 'jwt', refreshToken: 'id.secret', expiresIn: 900000 } },
|
|
59
|
-
}),
|
|
57
|
+
(0, swagger_1.ApiOkResponse)({ type: token_dto_1.TokenResponseDto }),
|
|
60
58
|
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Invalid, expired, or reused refresh token' }),
|
|
61
59
|
__param(0, (0, common_1.Body)()),
|
|
62
60
|
__param(1, (0, common_2.Req)()),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/session.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAOyB;AACzB,kEAAiE;AACjE,mDAA+D;AAC/D,2DAAiE;AACjE,kEAAwD;AACxD,iEAA6D;AAC7D,yEAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"session.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/controllers/session.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,6CAOyB;AACzB,kEAAiE;AACjE,mDAA+D;AAC/D,2DAAiE;AACjE,kEAAwD;AACxD,iEAA6D;AAC7D,yEAAqE;AACrE,gDAAqE;AAErE,2CAAqC;AACrC,uEAAyE;AAMlE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC7B,YACkB,cAA8B,EAC9B,YAA0B;QAD1B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;IACzC,CAAC;IAaJ,YAAY,CAAS,IAAqB,EAAS,GAAY;QAC9D,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;IAChF,CAAC;IASD,MAAM,CAAgB,IAAU;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;IAOD,iBAAiB,CAAgB,IAAU;QAC1C,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;IASD,aAAa,CAAoC,SAAiB,EAAiB,IAAU;QAC5F,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,CAA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A,sBAAY,EAAC;QACb,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,4CAA4C;KACzD,CAAC;IACD,IAAA,uBAAa,EAAC,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE,EAAE,EAAE,CAAC;IACrE,WAAA,IAAA,cAAK,EAAC,WAAW,EAAE,sBAAa,CAAC,CAAA;IAAqB,WAAA,IAAA,wBAAW,GAAE,CAAA;;6CAAO,kBAAI;;sDAE5F;4BAnDW,iBAAiB;IAJ7B,IAAA,iBAAO,EAAC,SAAS,CAAC;IAClB,IAAA,mBAAU,EAAC,MAAM,CAAC;IAClB,IAAA,kBAAS,EAAC,yBAAY,CAAC;IACvB,IAAA,uBAAa,GAAE;qCAGmB,gCAAc;QAChB,4BAAY;GAHhC,iBAAiB,CAoD7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -18,7 +18,6 @@ __exportStar(require("./otp.dto"), exports);
|
|
|
18
18
|
__exportStar(require("./login.dto"), exports);
|
|
19
19
|
__exportStar(require("./register.dto"), exports);
|
|
20
20
|
__exportStar(require("./password.dto"), exports);
|
|
21
|
-
__exportStar(require("./invite.dto"), exports);
|
|
22
21
|
__exportStar(require("./token.dto"), exports);
|
|
23
22
|
__exportStar(require("./pin.dto"), exports);
|
|
24
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/auth/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/auth/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,8CAA4B;AAC5B,4CAA0B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/login.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/login.dto.ts"],"names":[],"mappings":"AAUA,qBACa,QAAQ;IAEpB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAWhC,iBAAiB,EAAG,MAAM,CAAC;IAQ3B,KAAK,EAAG,MAAM,CAAC;IASf,QAAQ,EAAG,MAAM,CAAC;CAClB"}
|
|
@@ -22,7 +22,9 @@ __decorate([
|
|
|
22
22
|
], LoginDto.prototype, "_authMethod", void 0);
|
|
23
23
|
__decorate([
|
|
24
24
|
(0, swagger_1.ApiPropertyOptional)({
|
|
25
|
-
|
|
25
|
+
example: 'c498758c-eec1-4a3b-b496-a6eddf498d4c',
|
|
26
|
+
description: 'Required when auth.method=phone. Single-use token from POST /auth/verify-otp when hasAccount is true. ' +
|
|
27
|
+
'Do not use the verificationId from send-otp.',
|
|
26
28
|
}),
|
|
27
29
|
(0, class_validator_1.IsString)(),
|
|
28
30
|
(0, class_validator_1.ValidateIf)((o) => o._authMethod === 'phone'),
|
|
@@ -30,13 +32,19 @@ __decorate([
|
|
|
30
32
|
__metadata("design:type", String)
|
|
31
33
|
], LoginDto.prototype, "verificationToken", void 0);
|
|
32
34
|
__decorate([
|
|
33
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
35
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
36
|
+
example: 'user@example.com',
|
|
37
|
+
description: 'Required when auth.method=email.',
|
|
38
|
+
}),
|
|
34
39
|
(0, class_validator_1.ValidateIf)((o) => o._authMethod === 'email'),
|
|
35
40
|
(0, class_validator_1.IsEmail)(),
|
|
36
41
|
__metadata("design:type", String)
|
|
37
42
|
], LoginDto.prototype, "email", void 0);
|
|
38
43
|
__decorate([
|
|
39
|
-
(0, swagger_1.ApiPropertyOptional)({
|
|
44
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
45
|
+
example: 'P@ssw0rd!',
|
|
46
|
+
description: 'Required when auth.method=email.',
|
|
47
|
+
}),
|
|
40
48
|
(0, class_validator_1.IsString)(),
|
|
41
49
|
(0, class_validator_1.ValidateIf)((o) => o._authMethod === 'email'),
|
|
42
50
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.dto.js","sourceRoot":"","sources":["../../../../src/modules/auth/dto/login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwF;AACxF,6CAAsD;AACtD,wGAAyF;
|
|
1
|
+
{"version":3,"file":"login.dto.js","sourceRoot":"","sources":["../../../../src/modules/auth/dto/login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwF;AACxF,6CAAsD;AACtD,wGAAyF;AASlF,IAAM,QAAQ,GAAd,MAAM,QAAQ;CA+BpB,CAAA;AA/BY,4BAAQ;AAEpB;IADC,IAAA,4BAAU,GAAE;;6CACmB;AAWhC;IATC,IAAA,6BAAmB,EAAC;QACpB,OAAO,EAAE,sCAAsC;QAC/C,WAAW,EACV,wGAAwG;YACxG,8CAA8C;KAC/C,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,EAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC;IACtD,IAAA,4BAAU,GAAE;;mDACc;AAQ3B;IANC,IAAA,6BAAmB,EAAC;QACpB,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,kCAAkC;KAC/C,CAAC;IACD,IAAA,4BAAU,EAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC;IACtD,IAAA,yBAAO,GAAE;;uCACK;AASf;IAPC,IAAA,6BAAmB,EAAC;QACpB,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,kCAAkC;KAC/C,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,EAAC,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,KAAK,OAAO,CAAC;IACtD,IAAA,4BAAU,GAAE;;0CACK;mBA9BN,QAAQ;IADpB,IAAA,6CAAe,GAAE;GACL,QAAQ,CA+BpB"}
|
|
@@ -12,4 +12,26 @@ export declare class VerifyOtpDto {
|
|
|
12
12
|
export declare class ResendOtpDto {
|
|
13
13
|
verificationId: string;
|
|
14
14
|
}
|
|
15
|
+
export declare class OtpGenerateDataDto {
|
|
16
|
+
verificationId: string;
|
|
17
|
+
expiresAt: number;
|
|
18
|
+
resendIn: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class OtpGenerateResponseDto {
|
|
21
|
+
success: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
data: OtpGenerateDataDto;
|
|
24
|
+
}
|
|
25
|
+
export declare class OtpVerifyDataDto {
|
|
26
|
+
subject: string;
|
|
27
|
+
channel: 'sms' | 'email';
|
|
28
|
+
verificationToken: string;
|
|
29
|
+
expiresAt: number;
|
|
30
|
+
hasAccount: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare class OtpVerifyResponseDto {
|
|
33
|
+
success: boolean;
|
|
34
|
+
message: string;
|
|
35
|
+
data: OtpVerifyDataDto;
|
|
36
|
+
}
|
|
15
37
|
//# sourceMappingURL=otp.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otp.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/otp.dto.ts"],"names":[],"mappings":"AAsBA,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,OAAO,CAI7D;AAED,qBACa,UAAU;IAGtB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAUhC,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAQ1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"otp.dto.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/dto/otp.dto.ts"],"names":[],"mappings":"AAsBA,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,OAAO,CAI7D;AAED,qBACa,UAAU;IAGtB,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAUhC,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAQ1B,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,YAAY;IAQxB,cAAc,EAAG,MAAM,CAAC;IASxB,GAAG,EAAG,MAAM,CAAC;CACb;AAED,qBAAa,YAAY;IAMxB,cAAc,EAAG,MAAM,CAAC;CACxB;AAID,qBAAa,kBAAkB;IAI9B,cAAc,EAAG,MAAM,CAAC;IAGxB,SAAS,EAAG,MAAM,CAAC;IAGnB,QAAQ,EAAG,MAAM,CAAC;CAClB;AAED,qBAAa,sBAAsB;IAElC,OAAO,EAAG,OAAO,CAAC;IAGlB,OAAO,E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