Skip to content

Commit

Permalink
add password restriction in login submit b00tc4mp#167
Browse files Browse the repository at this point in the history
  • Loading branch information
annagonzalez9 committed Oct 9, 2024
1 parent dfad9e4 commit 6c6168a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions staff/anna-gonzalez/unsocial.1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ <h1>Unsocial</h1>
if (username.length < 4 || username.length > 12)
throw new Error('Invalid username')

if (password.length < 8)
throw new Error('Invalid password')

var user = users.find(function (user) {
return user.username === username && user.password === password
})
Expand Down
3 changes: 3 additions & 0 deletions staff/anna-gonzalez/unsocial/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ function loginUser(username, password) {
if (username.length < 4 || username.length > 12)
throw new Error('Invalid username')

if (password.length < 8)
throw new Error('Invalid password')

var user = users.find(function (user) {
return user.username === username && user.password === password
})
Expand Down

0 comments on commit 6c6168a

Please sign in to comment.