Skip to content

Latest commit

 

History

History
49 lines (36 loc) · 1.65 KB

CREDITS.md

File metadata and controls

49 lines (36 loc) · 1.65 KB

Credits, Notes, and References

Express.js References:

Google Login via Passport.js References:

From scratch:

npm install passport express-session passport-google-oauth2  --save

This isn't working when user visits other pages:

<% if (locals.user) { %>
    <li class="nav-item">
        <a class="nav-link" href="/user/profile">Profile</a>
    </li>
<%} else { %>
    <li class="nav-item">
        <a class="nav-link" href="/login">Login</a>
    </li>
<% } %>

... but here is a workaround: https://stackoverflow.com/questions/37183766/how-to-get-the-session-value-in-ejs

JavaScript dates:

 <% order.order_at.toDate().toUTCString() %>

<% var myDate = order.order_at.toDate() %>
<% var y = myDate.getFullYear() %>
<% var m = String(myDate.getMonth() + 1).padStart(2, '0') %>
<% var d = String(myDate.getDate()).padStart(2, '0'); %>