Skip to content

Commit

Permalink
modify the login and create functionality to work for capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
mThanuj committed Dec 9, 2024
1 parent e29f973 commit ec6a218
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/server/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export class AuthService {

async authenticate({ identifier, password }: LoginDto) {
try {
identifier = identifier.toLowerCase();
const user = await this.userService.findOneByIdentifierOrThrow(identifier);

if (!user.secrets?.password) {
Expand Down
4 changes: 3 additions & 1 deletion apps/server/src/storage/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export class StorageService implements OnModuleInit {
.toBuffer();
}

await this.client.putObject(this.bucketName, filepath, buffer, metadata);
const bufferSize = buffer.length;

await this.client.putObject(this.bucketName, filepath, buffer, bufferSize, metadata);

return url;
} catch {
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class UserService {
}

create(data: Prisma.UserCreateInput) {
data = { ...data, email: data.email.toLowerCase() };
return this.prisma.user.create({ data, include: { secrets: true } });
}

Expand Down
Binary file added bun.lockb
Binary file not shown.
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"@paralleldrive/cuid2": "^2.2.2",
"@pdf-lib/fontkit": "^1.1.1",
"@phosphor-icons/react": "^2.1.7",
"@prisma/client": "^5.19.0",
"@prisma/client": "^6.0.1",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-aspect-ratio": "^1.1.0",
Expand Down Expand Up @@ -211,7 +211,7 @@
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"pdf-lib": "^1.17.1",
"prisma": "^5.19.0",
"prisma": "^6.0.1",
"puppeteer": "^23.2.1",
"qrcode.react": "^4.0.1",
"react": "^18.3.1",
Expand Down Expand Up @@ -244,5 +244,17 @@
},
"prisma": {
"schema": "tools/prisma/schema.prisma"
}
},
"trustedDependencies": [
"@nestjs/core",
"@parcel/watcher",
"@prisma/client",
"@prisma/engines",
"@swc/core",
"esbuild",
"nx",
"prisma",
"puppeteer",
"sharp"
]
}

0 comments on commit ec6a218

Please sign in to comment.