Permalink
Browse files

Merge pull request #56 from jackbader/routes

done with shit
  • Loading branch information...
jackbader committed Oct 11, 2017
2 parents 4a33f8c + 100b830 commit a275f9c22ade5bc05254d18c4f06f43b6c991b76
View
@@ -48,7 +48,7 @@
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li class="firstNavItem"></li>
<li class="secondNavItem"></li>
<li><a href="userProfile.html"><i class="material-icons prefix">account_circle</i></a></li>
<li><a id='profileButton'><i class="material-icons prefix">account_circle</i></a></li>
</ul>
</div>
</nav>
View
@@ -42,7 +42,7 @@
<li class = "firstNavItem"></li>
<li class = "secondNavItem"></li>
<li class = "editNavItem"></li>
<li><a href="userProfile.html"><i class="material-icons prefix">account_circle</i></a></li>
<li><a id='profileButton'><i class="material-icons prefix">account_circle</i></a></li>
</ul>
</div>
</nav>
View
@@ -43,7 +43,7 @@
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li class="firstNavItem"></li>
<li class="secondNavItem"></li>
<li><a href="userProfile.html"><i class="material-icons prefix">account_circle</i></a></li>
<li><a id='profileButton'><i class="material-icons prefix">account_circle</i></a></li>
</ul>
</div>
</nav>
View
@@ -4,22 +4,6 @@ $(document).ready(() => {
$('#myInput').val('')
$('#profileButton').click(function() {
$.getJSON('/token')
.done((data) => {
if (data.hasToken === false) {
Materialize.toast('You must be logged in to view that!', 3000);
} else {
window.location.href = `/userProfile.html?id=${data.cookies.userId}`;
}
console.log(data.hasToken)
})
console.log('test')
})
const slick = function () {
$.getJSON('/items')
View
@@ -4,6 +4,22 @@ $(document).ready(() => {
console.log('ready test')
$('#profileButton').click(function() {
$.getJSON('/token')
.done((data) => {
if (data.hasToken === false) {
Materialize.toast('You must be logged in to view that!', 3000);
} else {
window.location.href = `/userProfile.html?id=${data.cookies.userId}`;
}
console.log(data.hasToken)
})
console.log('test')
})
$.getJSON('/token')
.done((data) => {
const $firstNavItems = $('.firstNavItem');
@@ -3,3 +3,7 @@ body {
width: 100%;
/*background-color: red;*/
}
nav {
background-color: #6BBA54 !important;
}
@@ -3,3 +3,7 @@ body {
width: 100%;
/*background-color: red;*/
}
nav {
background-color: #6BBA54 !important;
}
View
@@ -47,6 +47,7 @@
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li class="firstNavItem"></li>
<li class="secondNavItem"></li>
<li><a id='profileButton'><i class="material-icons prefix">account_circle</i></a></li>
</ul>
</div>
</nav>
View
@@ -22,6 +22,7 @@
<!-- my js -->
<script src = "js/signup.js"></script>
<script src = "js/nav.js"></script>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
@@ -40,6 +41,9 @@
<div class="nav-wrapper">
<a href="index.html" class="brand-logo">Logo</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li class="firstNavItem"></li>
<li class="secondNavItem"></li>
<li><a id='profileButton'><i class="material-icons prefix">account_circle</i></a></li>
</ul>
</div>
</nav>
View
@@ -41,10 +41,11 @@ router.post('/token', (req, res, next) => {
knex('users')
.where('email', email)
.orWhere('username', email)
.first()
.then((row) => {
if (!row) {
throw boom.create(400, 'Bad email or password');
throw Materialize.toast('Bad email or password', 3000);
}
user = camelizeKeys(row);

0 comments on commit a275f9c

Please sign in to comment.