Skip to content

Commit

Permalink
Initial password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BoogieMonster1O1 committed Jun 20, 2024
1 parent 206e96f commit a3ac0fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/App/Controllers/Auth/SignupController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ struct SignupController: RouteCollection {
if payload.subject.value != "credentials" {
throw Abort(.badRequest, reason: "Invalid bearer token")
}

if (pwBody.password.count < 8) {
throw Abort(.badRequest, reason: "Password must be at least 8 characters long")
}

let user = try await UnregisteredUser.query(on: req.db)
.filter(\.$id == payload.id)
Expand Down

0 comments on commit a3ac0fd

Please sign in to comment.