Skip to content

Commit

Permalink
Added a check for an invalid username
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkenney committed Nov 24, 2023
1 parent 3016463 commit 666bf24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/recommenderapp/static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ $(document).ready(function () {
$("#newPassword").val("")
$("#dupPassword").val("")
$("#misMatchPass").attr("class", "d-flex justify-content-center")
} else {
} else if (username == 'testUser'){
$("#newUser").val("")
$("#invalidUsername").attr("class", "d-flex justify-content-center")
} else {
data = {
email: email,
username: username,
Expand Down
3 changes: 3 additions & 0 deletions src/recommenderapp/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ <h3 style="width:50%; align-items: center; border-radius: 40px;">Re-enter Your P
<div class="d-none" id="misMatchPass" style="orientation: portrait;">
<h3 style="color:red; height: 30%;">Passwords do not match!</h3>
</div>
<div class="d-none" id="invalidUsername" style="orientation: portrait;">
<h3 style="color:red; height: 30%;">Invalid Username</h3>
</div>
<br>
<div>
<center>
Expand Down

0 comments on commit 666bf24

Please sign in to comment.