Skip to content

Commit

Permalink
Lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
codergautam committed Dec 23, 2023
1 parent 9ea43c0 commit 9a08225
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class AuthService {

async register(data: RegisterDTO) {
// validate username
data.username = data.username.toLowerCase();
if(validateUsername(data.username)) {
throw new UnauthorizedException(validateUsername(data.username));
}
Expand All @@ -31,6 +32,7 @@ export class AuthService {
}

async login(data: LoginDTO) {
data.username = data.username.toLowerCase();
let account;
try {
account = await this.accountsService.findOne({ where: { username: data.username } }, true);
Expand Down

0 comments on commit 9a08225

Please sign in to comment.