Display error message when login fails
This commit is contained in:
		
							parent
							
								
									5d12cb64e4
								
							
						
					
					
						commit
						15d50a7c50
					
				
					 2 changed files with 2 additions and 0 deletions
				
			
		|  | @ -22,6 +22,7 @@ function postToLoginEndpoint(event) { | |||
|                 localStorage.setItem("token", token); | ||||
|                 window.location.replace("home.html"); | ||||
|             } else { | ||||
|                 document.getElementById("errorLogin").innerHTML = "Incorrect user name or password"; | ||||
|                 console.error("LOGIN FAILURE!"); | ||||
|                 console.error("Server status: " + this.status); | ||||
|                 console.error("Server response:\n" + this.response); | ||||
|  |  | |||
|  | @ -31,6 +31,7 @@ | |||
|                                 <label for="formGroupPassword">Password:</label> | ||||
|                                 <input class="form-control" id="formGroupPassword" type="password" name="password" required> | ||||
|                             </div> | ||||
|                             <p id="errorLogin" style="color:red"></p> | ||||
|                             <button type="submit" class="btn btn-primary pull-right">Submit</button> | ||||
|                         </form> | ||||
|                     </div> | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jack
						Jack