Commit 20d5b2c9101a7705b03e1e32f430166ba99a9b85

Authored by Paul Wallace
1 parent 4947b376f0
Exists in master

Update the log in feature

Showing 3 changed files with 9 additions and 4 deletions Side-by-side Diff

... ... @@ -13,7 +13,7 @@
13 13 app.set('view engine', 'ejs');
14 14  
15 15 app.get('/', function(request, response) {
16   - response.render('pages/index');
  16 + response.render('pages/index', request.query);
17 17 });
18 18  
19 19 app.get('/landing', function(request, response) {
views/pages/index.ejs View file @ 20d5b2c
... ... @@ -13,11 +13,15 @@
13 13 <p>The best way to find the safest routes.</p>
14 14 </div>
15 15  
16   - <form action="/login">
17   -
  16 + <% if(!locals.loggedin || (locals.loggedin != "true")){ %>
  17 +
  18 + <%console.log(locals.loggedin)%>
  19 + <form action="/login">
  20 +
18 21 <button type="submit" class="btn btn-primary">Log In</button>
19 22 <!-- <input type="submit" value="Submit"> -->
20   - </form>
  23 + </form>
  24 + <% } %>
21 25  
22 26  
23 27  
views/pages/login.ejs View file @ 20d5b2c
... ... @@ -10,6 +10,7 @@
10 10 <div class="container-fluid">
11 11 <form action="/">
12 12 <div class="form-group">
  13 + <input type="hidden" name="loggedin" value="true"/>
13 14 <input type="currentLocation" class="form-control" id="origin" placeholder="Username" onchange="saveFrom()">
14 15 <input type="currentLocation" class="form-control" id="origin" placeholder="Password" onchange="saveFrom()">
15 16 </div>