@j3r3mcdev/auth-service 1.0.0 → 1.0.8

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.
Files changed (65) hide show
  1. package/README.md +0 -0
  2. package/dist/hashing.d.ts +2 -0
  3. package/dist/hashing.d.ts.map +1 -0
  4. package/dist/hashing.js +8 -0
  5. package/dist/index.d.ts +4 -12
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -30
  8. package/dist/sanitize.d.ts +2 -0
  9. package/dist/sanitize.d.ts.map +1 -0
  10. package/dist/sanitize.js +5 -0
  11. package/dist/tokens.d.ts +6 -0
  12. package/dist/tokens.d.ts.map +1 -0
  13. package/dist/tokens.js +11 -0
  14. package/dist/validators.d.ts +3 -0
  15. package/dist/validators.d.ts.map +1 -0
  16. package/dist/validators.js +14 -0
  17. package/package.json +46 -8
  18. package/dist/auth/auth.controller.d.ts +0 -60
  19. package/dist/auth/auth.controller.d.ts.map +0 -1
  20. package/dist/auth/auth.controller.js +0 -128
  21. package/dist/auth/auth.module.d.ts +0 -3
  22. package/dist/auth/auth.module.d.ts.map +0 -1
  23. package/dist/auth/auth.module.js +0 -44
  24. package/dist/auth/auth.repository.d.ts +0 -119
  25. package/dist/auth/auth.repository.d.ts.map +0 -1
  26. package/dist/auth/auth.repository.js +0 -108
  27. package/dist/auth/auth.service.d.ts +0 -61
  28. package/dist/auth/auth.service.d.ts.map +0 -1
  29. package/dist/auth/auth.service.js +0 -287
  30. package/dist/auth/dto/forgot-password.dto.d.ts +0 -4
  31. package/dist/auth/dto/forgot-password.dto.d.ts.map +0 -1
  32. package/dist/auth/dto/forgot-password.dto.js +0 -21
  33. package/dist/auth/dto/login.dto.d.ts +0 -5
  34. package/dist/auth/dto/login.dto.d.ts.map +0 -1
  35. package/dist/auth/dto/login.dto.js +0 -26
  36. package/dist/auth/dto/refresh.dto.d.ts +0 -4
  37. package/dist/auth/dto/refresh.dto.d.ts.map +0 -1
  38. package/dist/auth/dto/refresh.dto.js +0 -21
  39. package/dist/auth/dto/register.dto.d.ts +0 -5
  40. package/dist/auth/dto/register.dto.d.ts.map +0 -1
  41. package/dist/auth/dto/register.dto.js +0 -27
  42. package/dist/auth/dto/reset-password.dto.d.ts +0 -5
  43. package/dist/auth/dto/reset-password.dto.d.ts.map +0 -1
  44. package/dist/auth/dto/reset-password.dto.js +0 -27
  45. package/dist/auth/dto/update-user.dto.d.ts +0 -5
  46. package/dist/auth/dto/update-user.dto.d.ts.map +0 -1
  47. package/dist/auth/dto/update-user.dto.js +0 -28
  48. package/dist/auth/guards/jwt.guard.d.ts +0 -5
  49. package/dist/auth/guards/jwt.guard.d.ts.map +0 -1
  50. package/dist/auth/guards/jwt.guard.js +0 -18
  51. package/dist/auth/guards/jwt.refresh-guard.d.ts +0 -5
  52. package/dist/auth/guards/jwt.refresh-guard.d.ts.map +0 -1
  53. package/dist/auth/guards/jwt.refresh-guard.js +0 -18
  54. package/dist/auth/strategies/jwt-refresh.strategy.d.ts +0 -22
  55. package/dist/auth/strategies/jwt-refresh.strategy.d.ts.map +0 -1
  56. package/dist/auth/strategies/jwt-refresh.strategy.js +0 -45
  57. package/dist/auth/strategies/jwt.strategy.d.ts +0 -10
  58. package/dist/auth/strategies/jwt.strategy.d.ts.map +0 -1
  59. package/dist/auth/strategies/jwt.strategy.js +0 -33
  60. package/dist/auth/strategies/strategies/jwt-refresh.strategy.d.ts +0 -22
  61. package/dist/auth/strategies/strategies/jwt-refresh.strategy.d.ts.map +0 -1
  62. package/dist/auth/strategies/strategies/jwt-refresh.strategy.js +0 -45
  63. package/dist/auth/strategies/strategies/jwt.strategy.d.ts +0 -10
  64. package/dist/auth/strategies/strategies/jwt.strategy.d.ts.map +0 -1
  65. package/dist/auth/strategies/strategies/jwt.strategy.js +0 -33
@@ -1,108 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AuthRepository = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const client_1 = require("@prisma/client");
15
- let AuthRepository = class AuthRepository {
16
- prisma;
17
- constructor(prisma) {
18
- this.prisma = prisma;
19
- }
20
- // -------------------------
21
- // USERS
22
- // -------------------------
23
- createUser(data) {
24
- return this.prisma.user.create({ data });
25
- }
26
- findByEmail(email) {
27
- return this.prisma.user.findUnique({
28
- where: { email },
29
- });
30
- }
31
- findById(id) {
32
- return this.prisma.user.findUnique({
33
- where: { id },
34
- });
35
- }
36
- updateUser(id, data) {
37
- return this.prisma.user.update({
38
- where: { id },
39
- data,
40
- });
41
- }
42
- // -------------------------
43
- // REFRESH TOKEN
44
- // -------------------------
45
- updateRefreshToken(id, refreshToken) {
46
- return this.prisma.user.update({
47
- where: { id },
48
- data: { refreshToken },
49
- });
50
- }
51
- clearRefreshToken(id) {
52
- return this.prisma.user.update({
53
- where: { id },
54
- data: { refreshToken: null },
55
- });
56
- }
57
- // -------------------------
58
- // RESET PASSWORD
59
- // -------------------------
60
- setResetToken(id, tokenHash, expiresAt) {
61
- return this.prisma.user.update({
62
- where: { id },
63
- data: {
64
- resetToken: tokenHash,
65
- resetTokenExpiresAt: expiresAt,
66
- },
67
- });
68
- }
69
- /**
70
- * IMPORTANT :
71
- * On NE filtre PLUS l'expiration ici.
72
- * Le service reset-password gère déjà :
73
- * - token invalide
74
- * - token expiré
75
- * - token absent
76
- *
77
- * Donc ici on doit juste retrouver l'utilisateur par resetToken.
78
- */
79
- findByResetToken(tokenHash) {
80
- return this.prisma.user.findFirst({
81
- where: {
82
- resetToken: tokenHash, // ✔ plus de resetTokenExpiresAt: { gt: new Date() }
83
- },
84
- });
85
- }
86
- clearResetToken(id) {
87
- return this.prisma.user.update({
88
- where: { id },
89
- data: {
90
- resetToken: null,
91
- resetTokenExpiresAt: null,
92
- },
93
- });
94
- }
95
- updatePassword(id, hashedPassword) {
96
- return this.prisma.user.update({
97
- where: { id },
98
- data: {
99
- password: hashedPassword,
100
- },
101
- });
102
- }
103
- };
104
- exports.AuthRepository = AuthRepository;
105
- exports.AuthRepository = AuthRepository = __decorate([
106
- (0, common_1.Injectable)(),
107
- __metadata("design:paramtypes", [client_1.PrismaClient])
108
- ], AuthRepository);
@@ -1,61 +0,0 @@
1
- import { AuthRepository } from './auth.repository';
2
- import { JwtService } from '@nestjs/jwt';
3
- import { RegisterDto } from './dto/register.dto';
4
- import { LoginDto } from './dto/login.dto';
5
- import { RefreshDto } from './dto/refresh.dto';
6
- import { UpdateUserDto } from './dto/update-user.dto';
7
- import { ForgotPasswordDto } from './dto/forgot-password.dto';
8
- import { ResetPasswordDto } from './dto/reset-password.dto';
9
- export declare class AuthService {
10
- private readonly repo;
11
- private readonly jwt;
12
- private readonly isE2E;
13
- constructor(repo: AuthRepository, jwt: JwtService);
14
- sha256(data: string): string;
15
- generateTokens(user: {
16
- id: string;
17
- email: string;
18
- }): {
19
- accessToken: string;
20
- refreshToken: string;
21
- };
22
- register(dto: RegisterDto): Promise<{
23
- accessToken: string;
24
- refreshToken: string;
25
- message: string;
26
- }>;
27
- login(dto: LoginDto): Promise<{
28
- accessToken: string;
29
- refreshToken: string;
30
- message: string;
31
- }>;
32
- me(userId: string): Promise<{
33
- sub: string;
34
- email: string;
35
- }>;
36
- updateUser(userId: string, dto: UpdateUserDto): Promise<{
37
- message: string;
38
- user: {
39
- id: string;
40
- email: string;
41
- };
42
- email?: undefined;
43
- } | {
44
- message: string;
45
- email: string;
46
- user?: undefined;
47
- }>;
48
- logout(userId: string): Promise<{
49
- message: string;
50
- }>;
51
- refresh(dto: RefreshDto): Promise<{
52
- accessToken: string;
53
- refreshToken: string;
54
- message: string;
55
- }>;
56
- forgotPassword(dto: ForgotPasswordDto): Promise<string | undefined>;
57
- resetPassword(dto: ResetPasswordDto): Promise<{
58
- message: string;
59
- }>;
60
- }
61
- //# sourceMappingURL=auth.service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,qBACa,WAAW;IAIpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAJtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuC;gBAG1C,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,UAAU;IAOlC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI5B,cAAc,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;;;;IA+B5C,QAAQ,CAAC,GAAG,EAAE,WAAW;;;;;IAwCzB,KAAK,CAAC,GAAG,EAAE,QAAQ;;;;;IA+BnB,EAAE,CAAC,MAAM,EAAE,MAAM;;;;IAcjB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;;;;;;;;;;;;IA4B7C,MAAM,CAAC,MAAM,EAAE,MAAM;;;IAkBrB,OAAO,CAAC,GAAG,EAAE,UAAU;;;;;IA8CvB,cAAc,CAAC,GAAG,EAAE,iBAAiB;IAqBrC,aAAa,CAAC,GAAG,EAAE,gBAAgB;;;CAqB1C"}
@@ -1,287 +0,0 @@
1
- "use strict";
2
- // cSpell: disable
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
20
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
21
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
22
- 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;
23
- return c > 3 && r && Object.defineProperty(target, key, r), r;
24
- };
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- var __metadata = (this && this.__metadata) || function (k, v) {
43
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.AuthService = void 0;
47
- const common_1 = require("@nestjs/common");
48
- const bcrypt = __importStar(require("bcrypt"));
49
- const auth_repository_1 = require("./auth.repository");
50
- const jwt_1 = require("@nestjs/jwt");
51
- const crypto_1 = require("crypto");
52
- let AuthService = class AuthService {
53
- repo;
54
- jwt;
55
- isE2E = process.env.NODE_ENV === 'test:e2e';
56
- constructor(repo, jwt) {
57
- this.repo = repo;
58
- this.jwt = jwt;
59
- }
60
- // -------------------------
61
- // UTILS
62
- // -------------------------
63
- sha256(data) {
64
- return (0, crypto_1.createHash)('sha256').update(data).digest('hex');
65
- }
66
- generateTokens(user) {
67
- const payload = { sub: user.id, email: user.email };
68
- try {
69
- const accessToken = this.jwt.sign(payload, {
70
- secret: process.env.JWT_SECRET,
71
- expiresIn: '15m',
72
- });
73
- const refreshToken = this.jwt.sign({
74
- ...payload,
75
- type: 'refresh',
76
- jti: (0, crypto_1.randomBytes)(16).toString('hex'), // token unique
77
- }, {
78
- secret: process.env.JWT_REFRESH_SECRET,
79
- expiresIn: '7d',
80
- });
81
- return { accessToken, refreshToken };
82
- }
83
- catch {
84
- throw new Error('jwt failed');
85
- }
86
- }
87
- // -------------------------
88
- // REGISTER
89
- // -------------------------
90
- async register(dto) {
91
- const hashed = await bcrypt.hash(dto.password, 10);
92
- let user;
93
- try {
94
- user = await this.repo.createUser({
95
- email: dto.email,
96
- password: hashed,
97
- });
98
- }
99
- catch (err) {
100
- if (err?.code === 'P2002') {
101
- throw new common_1.ConflictException('Email already exists');
102
- }
103
- throw err;
104
- }
105
- let tokens;
106
- try {
107
- tokens = this.generateTokens(user);
108
- }
109
- catch {
110
- throw new Error('jwt failed');
111
- }
112
- try {
113
- const refreshHash = await bcrypt.hash(tokens.refreshToken, 10);
114
- await this.repo.updateRefreshToken(user.id, refreshHash);
115
- }
116
- catch {
117
- throw new Error('refresh failed');
118
- }
119
- return {
120
- message: 'User registered',
121
- ...tokens,
122
- };
123
- }
124
- // -------------------------
125
- // LOGIN
126
- // -------------------------
127
- async login(dto) {
128
- const user = await this.repo.findByEmail(dto.email);
129
- if (!user)
130
- throw new common_1.ForbiddenException('Invalid credentials');
131
- const valid = await bcrypt.compare(dto.password, user.password);
132
- if (!valid)
133
- throw new common_1.ForbiddenException('Invalid credentials');
134
- let tokens;
135
- try {
136
- tokens = this.generateTokens(user);
137
- }
138
- catch {
139
- throw new Error('jwt failed');
140
- }
141
- try {
142
- const refreshHash = await bcrypt.hash(tokens.refreshToken, 10);
143
- await this.repo.updateRefreshToken(user.id, refreshHash);
144
- }
145
- catch {
146
- throw new Error('refresh failed');
147
- }
148
- return {
149
- message: 'Login successful',
150
- ...tokens,
151
- };
152
- }
153
- // -------------------------
154
- // ME
155
- // -------------------------
156
- async me(userId) {
157
- const user = await this.repo.findById(userId);
158
- if (!user)
159
- throw new common_1.NotFoundException('User not found');
160
- return {
161
- sub: user.id,
162
- email: user.email,
163
- };
164
- }
165
- // -------------------------
166
- // UPDATE USER
167
- // -------------------------
168
- async updateUser(userId, dto) {
169
- const data = {};
170
- if (dto.email)
171
- data.email = dto.email;
172
- if (dto.password)
173
- data.password = await bcrypt.hash(dto.password, 10);
174
- const updated = await this.repo.updateUser(userId, data);
175
- if (!this.isE2E) {
176
- return {
177
- message: 'User updated successfully',
178
- user: {
179
- id: updated.id,
180
- email: updated.email,
181
- },
182
- };
183
- }
184
- return {
185
- message: 'User updated',
186
- email: updated.email,
187
- };
188
- }
189
- // -------------------------
190
- // LOGOUT
191
- // -------------------------
192
- async logout(userId) {
193
- if (!this.isE2E) {
194
- try {
195
- await this.repo.updateRefreshToken(userId, null);
196
- }
197
- catch {
198
- throw new Error('DB error');
199
- }
200
- }
201
- else {
202
- await this.repo.clearRefreshToken(userId);
203
- }
204
- return { message: 'Logged out' };
205
- }
206
- // -------------------------
207
- // REFRESH (sans guard)
208
- // -------------------------
209
- async refresh(dto) {
210
- const { refreshToken } = dto;
211
- if (!refreshToken) {
212
- throw new common_1.ForbiddenException('Access denied');
213
- }
214
- let payload;
215
- try {
216
- payload = this.jwt.verify(refreshToken, {
217
- secret: process.env.JWT_REFRESH_SECRET,
218
- });
219
- }
220
- catch {
221
- throw new common_1.ForbiddenException('Access denied');
222
- }
223
- const user = await this.repo.findById(payload.sub);
224
- if (!user)
225
- throw new common_1.ForbiddenException('Access denied');
226
- const valid = await bcrypt.compare(refreshToken, user.refreshToken);
227
- if (!valid)
228
- throw new common_1.ForbiddenException('Access denied');
229
- let tokens;
230
- try {
231
- tokens = this.generateTokens(user);
232
- }
233
- catch {
234
- throw new Error('jwt failed');
235
- }
236
- try {
237
- const newHash = await bcrypt.hash(tokens.refreshToken, 10);
238
- await this.repo.updateRefreshToken(user.id, newHash);
239
- }
240
- catch {
241
- throw new Error('refresh failed');
242
- }
243
- return {
244
- message: 'Token refreshed',
245
- ...tokens,
246
- };
247
- }
248
- // -------------------------
249
- // FORGOT PASSWORD
250
- // -------------------------
251
- async forgotPassword(dto) {
252
- const user = await this.repo.findByEmail(dto.email);
253
- if (!user) {
254
- return this.isE2E ? 'Reset email sent' : undefined;
255
- }
256
- const token = (0, crypto_1.randomBytes)(32).toString('hex');
257
- const tokenHash = this.sha256(token);
258
- const expiresAt = new Date(Date.now() + 1000 * 60 * 15);
259
- await this.repo.setResetToken(user.id, tokenHash, expiresAt);
260
- return token;
261
- }
262
- // -------------------------
263
- // RESET PASSWORD
264
- // -------------------------
265
- async resetPassword(dto) {
266
- const tokenHash = this.sha256(dto.token);
267
- const user = await this.repo.findByResetToken(tokenHash);
268
- if (!user) {
269
- throw new common_1.ForbiddenException('Invalid or expired token');
270
- }
271
- if (!user.resetTokenExpiresAt || user.resetTokenExpiresAt < new Date()) {
272
- throw new common_1.ForbiddenException('Invalid or expired token');
273
- }
274
- const hashedPassword = await bcrypt.hash(dto.password, 10);
275
- await this.repo.updatePassword(user.id, hashedPassword);
276
- await this.repo.clearResetToken(user.id);
277
- return this.isE2E
278
- ? { message: 'Password reset successfully' }
279
- : { message: 'Password updated' };
280
- }
281
- };
282
- exports.AuthService = AuthService;
283
- exports.AuthService = AuthService = __decorate([
284
- (0, common_1.Injectable)(),
285
- __metadata("design:paramtypes", [auth_repository_1.AuthRepository,
286
- jwt_1.JwtService])
287
- ], AuthService);
@@ -1,4 +0,0 @@
1
- export declare class ForgotPasswordDto {
2
- email: string;
3
- }
4
- //# sourceMappingURL=forgot-password.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"forgot-password.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/forgot-password.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,iBAAiB;IAE5B,KAAK,EAAG,MAAM,CAAC;CAChB"}
@@ -1,21 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ForgotPasswordDto = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class ForgotPasswordDto {
15
- email;
16
- }
17
- exports.ForgotPasswordDto = ForgotPasswordDto;
18
- __decorate([
19
- (0, class_validator_1.IsEmail)(),
20
- __metadata("design:type", String)
21
- ], ForgotPasswordDto.prototype, "email", void 0);
@@ -1,5 +0,0 @@
1
- export declare class LoginDto {
2
- email: string;
3
- password: string;
4
- }
5
- //# sourceMappingURL=login.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/login.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IAEnB,KAAK,EAAG,MAAM,CAAC;IAGf,QAAQ,EAAG,MAAM,CAAC;CACnB"}
@@ -1,26 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LoginDto = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class LoginDto {
15
- email;
16
- password;
17
- }
18
- exports.LoginDto = LoginDto;
19
- __decorate([
20
- (0, class_validator_1.IsEmail)(),
21
- __metadata("design:type", String)
22
- ], LoginDto.prototype, "email", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsString)(),
25
- __metadata("design:type", String)
26
- ], LoginDto.prototype, "password", void 0);
@@ -1,4 +0,0 @@
1
- export declare class RefreshDto {
2
- refreshToken: string;
3
- }
4
- //# sourceMappingURL=refresh.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"refresh.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/refresh.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IAErB,YAAY,EAAG,MAAM,CAAC;CACvB"}
@@ -1,21 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RefreshDto = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class RefreshDto {
15
- refreshToken;
16
- }
17
- exports.RefreshDto = RefreshDto;
18
- __decorate([
19
- (0, class_validator_1.IsString)(),
20
- __metadata("design:type", String)
21
- ], RefreshDto.prototype, "refreshToken", void 0);
@@ -1,5 +0,0 @@
1
- export declare class RegisterDto {
2
- email: string;
3
- password: string;
4
- }
5
- //# sourceMappingURL=register.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/register.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,WAAW;IAEtB,KAAK,EAAG,MAAM,CAAC;IAIf,QAAQ,EAAG,MAAM,CAAC;CACnB"}
@@ -1,27 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RegisterDto = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class RegisterDto {
15
- email;
16
- password;
17
- }
18
- exports.RegisterDto = RegisterDto;
19
- __decorate([
20
- (0, class_validator_1.IsEmail)(),
21
- __metadata("design:type", String)
22
- ], RegisterDto.prototype, "email", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsString)(),
25
- (0, class_validator_1.MinLength)(6),
26
- __metadata("design:type", String)
27
- ], RegisterDto.prototype, "password", void 0);
@@ -1,5 +0,0 @@
1
- export declare class ResetPasswordDto {
2
- token: string;
3
- password: string;
4
- }
5
- //# sourceMappingURL=reset-password.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset-password.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/reset-password.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAE3B,KAAK,EAAG,MAAM,CAAC;IAIf,QAAQ,EAAG,MAAM,CAAC;CACnB"}
@@ -1,27 +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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ResetPasswordDto = void 0;
13
- const class_validator_1 = require("class-validator");
14
- class ResetPasswordDto {
15
- token;
16
- password;
17
- }
18
- exports.ResetPasswordDto = ResetPasswordDto;
19
- __decorate([
20
- (0, class_validator_1.IsString)(),
21
- __metadata("design:type", String)
22
- ], ResetPasswordDto.prototype, "token", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsString)(),
25
- (0, class_validator_1.MinLength)(6),
26
- __metadata("design:type", String)
27
- ], ResetPasswordDto.prototype, "password", void 0);
@@ -1,5 +0,0 @@
1
- export declare class UpdateUserDto {
2
- email?: string;
3
- password?: string;
4
- }
5
- //# sourceMappingURL=update-user.dto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-user.dto.d.ts","sourceRoot":"","sources":["../../../src/auth/dto/update-user.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,aAAa;IAGxB,KAAK,CAAC,EAAE,MAAM,CAAC;IAIf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}