Skip to content

Commit 4edc74f

Browse files
authored
feat(auth): add password change endpoint (btwld#20)
1 parent 08272d3 commit 4edc74f

35 files changed

Lines changed: 2456 additions & 2136 deletions

.claude/settings.local.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
"Bash(npm install:*)",
3636
"Bash(yarn add:*)",
3737
"Bash(yarn test:*)",
38-
"Bash(node:*)"
38+
"Bash(node:*)",
39+
"Bash(git diff:*)",
40+
"Bash(yarn install:*)"
3941
],
4042
"deny": []
4143
}
42-
}
44+
}

.cursor/rules/testing.mdc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
# Testing Rules
3+
Configuration for AI behavior when completing tasks
4+
5+
## CRITICAL: Before completing any task that involves code changes
6+
7+
After making code changes, you MUST run the following commands before finalizing your response:
8+
9+
1. **Build the project:**
10+
```bash
11+
yarn build
12+
```
13+
- If build fails, fix the errors before proceeding
14+
15+
2. **Run unit tests:**
16+
```bash
17+
yarn test
18+
```
19+
- If tests fail, fix the failing tests before proceeding
20+
21+
3. **Run e2e tests:**
22+
```bash
23+
yarn test:e2e
24+
```
25+
- If tests fail, fix the failing tests before proceeding
26+
27+
4. **Run linting:**
28+
```bash
29+
yarn lint
30+
```
31+
- If lint errors are found, fix them before proceeding
32+
33+
## Execution Order
34+
35+
The commands must be run in this order:
36+
1. `yarn build` - Ensure code compiles
37+
2. `yarn test` - Run unit tests
38+
3. `yarn test:e2e` - Run end-to-end tests
39+
4. `yarn lint` - Check code style
40+
41+
## When to Skip
42+
43+
You may skip these checks if:
44+
- The user explicitly asks you to skip testing
45+
- You are only making documentation changes (*.md files)
46+
- You are only making configuration changes that don't affect code
47+
48+
## Reporting
49+
50+
When reporting results to the user, include:
51+
- Number of tests passed/failed
52+
- Any lint errors that were found and fixed
53+
- Build status

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ dist
110110
# generated docs
111111
/docs
112112

113+
# generated SDK (orval)
114+
**/generated/api
115+
**/generated/models
116+
**/generated/zod
117+
113118
# .yarn meta
114119
.yarn
115120

examples/sample-server-auth/package.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,39 @@
4545
"resolutions": {
4646
"@nestjs/common": "10.4.19",
4747
"@nestjs/core": "10.4.19",
48+
"@nestjs/platform-express": "10.4.19",
49+
"@concepta/nestjs-access-control": "7.0.0-alpha.8",
50+
"@concepta/nestjs-auth-apple": "7.0.0-alpha.8",
51+
"@concepta/nestjs-auth-github": "7.0.0-alpha.8",
52+
"@concepta/nestjs-auth-google": "7.0.0-alpha.8",
53+
"@concepta/nestjs-auth-jwt": "7.0.0-alpha.8",
54+
"@concepta/nestjs-auth-local": "7.0.0-alpha.8",
55+
"@concepta/nestjs-auth-recovery": "7.0.0-alpha.8",
56+
"@concepta/nestjs-auth-refresh": "7.0.0-alpha.8",
57+
"@concepta/nestjs-auth-router": "7.0.0-alpha.8",
58+
"@concepta/nestjs-auth-verify": "7.0.0-alpha.8",
59+
"@concepta/nestjs-authentication": "7.0.0-alpha.8",
60+
"@concepta/nestjs-common": "7.0.0-alpha.8",
61+
"@concepta/nestjs-crud": "7.0.0-alpha.8",
62+
"@concepta/nestjs-email": "7.0.0-alpha.8",
63+
"@concepta/nestjs-event": "7.0.0-alpha.8",
64+
"@concepta/nestjs-federated": "7.0.0-alpha.8",
65+
"@concepta/nestjs-invitation": "7.0.0-alpha.8",
66+
"@concepta/nestjs-jwt": "7.0.0-alpha.8",
67+
"@concepta/nestjs-otp": "7.0.0-alpha.8",
68+
"@concepta/nestjs-password": "7.0.0-alpha.8",
69+
"@concepta/nestjs-role": "7.0.0-alpha.8",
70+
"@concepta/nestjs-swagger-ui": "7.0.0-alpha.8",
71+
"@concepta/nestjs-user": "7.0.0-alpha.8",
72+
"@concepta/nestjs-typeorm-ext": "7.0.0-alpha.8",
4873
"glob": "10.5.0",
4974
"js-yaml": "4.1.1",
5075
"jws": "3.2.3",
5176
"multer": "2.0.2",
5277
"path-to-regexp": "3.3.0",
5378
"qs": "6.14.1",
5479
"tar": "7.5.2",
55-
"validator": "13.15.22"
80+
"validator": "13.15.22",
81+
"lodash": "4.17.23"
5682
}
5783
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { RocketsAuthUserCreateDto } from '@bitwild/rockets-auth';
2-
import { ApiProperty } from '@nestjs/swagger';
2+
import { ApiPropertyOptional } from '@nestjs/swagger';
33
import { Expose, Type } from 'class-transformer';
44
import { IsOptional, ValidateNested } from 'class-validator';
55
import { UserMetadataDto } from './user-metadata.dto';
66

77
/**
88
* User Create DTO
99
*
10-
* Extends RocketsAuthUserCreateDto with userMetadata field
11-
* to support creating users with metadata.
10+
* Extends RocketsAuthUserCreateDto with custom userMetadata field.
11+
* Overrides the base userMetadata to use project-specific UserMetadataDto.
1212
*/
1313
export class UserCreateDto extends RocketsAuthUserCreateDto {
14-
@ApiProperty({ type: UserMetadataDto, required: false, description: 'User metadata' })
14+
@ApiPropertyOptional({ type: UserMetadataDto, description: 'User metadata' })
1515
@Expose()
1616
@IsOptional()
1717
@ValidateNested()
1818
@Type(() => UserMetadataDto)
19-
declare userMetadata?: UserMetadataDto;
19+
userMetadata?: UserMetadataDto;
2020
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { RocketsAuthUserUpdateDto } from '@bitwild/rockets-auth';
2-
import { ApiProperty } from '@nestjs/swagger';
2+
import { ApiPropertyOptional } from '@nestjs/swagger';
33
import { Expose, Type } from 'class-transformer';
44
import { IsOptional, ValidateNested } from 'class-validator';
55
import { UserMetadataDto } from './user-metadata.dto';
66

77
/**
88
* User Update DTO
99
*
10-
* Extends RocketsAuthUserUpdateDto with userMetadata field
11-
* to support updating users with metadata.
10+
* Extends RocketsAuthUserUpdateDto with custom userMetadata field.
11+
* Overrides the base userMetadata to use project-specific UserMetadataDto.
1212
*/
1313
export class UserUpdateDto extends RocketsAuthUserUpdateDto {
14-
@ApiProperty({ type: UserMetadataDto, required: false, description: 'User metadata' })
14+
@ApiPropertyOptional({ type: UserMetadataDto, description: 'User metadata' })
1515
@Expose()
1616
@IsOptional()
1717
@ValidateNested()
1818
@Type(() => UserMetadataDto)
19-
declare userMetadata?: UserMetadataDto;
19+
userMetadata?: UserMetadataDto;
2020
}
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import { RocketsAuthUserDto, RocketsAuthUserMetadataDto } from '@bitwild/rockets-auth';
2-
import { ApiProperty } from '@nestjs/swagger';
1+
import { RocketsAuthUserDto } from '@bitwild/rockets-auth';
2+
import { ApiPropertyOptional } from '@nestjs/swagger';
33
import { Expose, Type } from 'class-transformer';
44
import { IsOptional, ValidateNested } from 'class-validator';
55
import { UserMetadataDto } from './user-metadata.dto';
66

7+
/**
8+
* User DTO
9+
*
10+
* Extends RocketsAuthUserDto with custom userMetadata field.
11+
* Overrides the base userMetadata to use project-specific UserMetadataDto.
12+
*/
713
export class UserDto extends RocketsAuthUserDto {
8-
@ApiProperty({ type: UserMetadataDto, required: false, description: 'User metadata' })
14+
@ApiPropertyOptional({ type: UserMetadataDto, description: 'User metadata' })
915
@Expose()
1016
@IsOptional()
1117
@ValidateNested()
1218
@Type(() => UserMetadataDto)
13-
declare userMetadata?: UserMetadataDto;
19+
userMetadata?: UserMetadataDto = undefined;
1420
}

0 commit comments

Comments
 (0)