Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
basil-reji committed Apr 29, 2023
1 parent 4543bb3 commit fa4c2c3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,12 @@ router.get('/logout', function (req, res, next) {
});
});

router.get('/admin/logout', function (req, res, next) {
req.logout(function (err) {
if (err) { return next(err); }
if (req.session) { req.session.destroy() }
res.redirect('/');
});
});

module.exports = router;
4 changes: 2 additions & 2 deletions views/admin/dashboard.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="col-lg-12">
<div class="row">

<!-- Customers Card -->
{{!-- <!-- Customers Card -->
<div class="col-xxl-4 col-xl-12">
<div class="card info-card customers-card">
Expand All @@ -27,7 +27,7 @@
</div>
</div>
</div><!-- End Customers Card -->
</div><!-- End Customers Card --> --}}

</div>
</div><!-- End Left side columns -->
Expand Down
8 changes: 4 additions & 4 deletions views/auth/login.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<input type="password" class="form-control" name="password" id="password"
placeholder="Password" required>
</div>
<div class="forgot">
{{!-- <div class="forgot">
<a href="/forgot-password">Forgot Password</a>
</div>
</div> --}}
<div class="text-center">
<button type="submit">Login</button>
</div>
</form>
<div class="log_footer">
{{!-- <div class="log_footer">
Don't have an account? <a href="/signup">Signup Now</a>
</div>
</div> --}}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion views/layout.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
{{#if user.permissions.admin}}
<script src="/javascripts/admin.js"></script>
{{else}}
<script src="/javascripts/script.js"></script>
<script src="/javascripts/main.js"></script>
{{/if}}

</body>
Expand Down
2 changes: 1 addition & 1 deletion views/partials/admin/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</a>
</li> --}}
<li>
<a class="dropdown-item d-flex align-items-center" href="/logout">
<a class="dropdown-item d-flex align-items-center" href="/admin/logout">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
Expand Down

0 comments on commit fa4c2c3

Please sign in to comment.