This snippet is to conditionally render navbar items based on whether a user is logged in OR not. So toggle the ‘Login’ button to ‘Logout’ if the user is already logged in and vice versa. I admit it took more time that I had anticipated. Primarily because in the beginning I insisted on using a global variable in express to manage the user’s ‘isAuthenticated’ state
Plug and Play Authentication for express.js
What started out as a small module has become a month long project. Some days I sleep well, other days I keep a notebook besides me to jot down ideas. I’ll be putting this project up on Product Hunt and Gumtree as a stand alone module for other developers to use. Version 1.0 has the following features: User can make an account using their
JWT: What are JSON Web Tokens & use cases
Same old web..new drama.. What are JSON Web Tokens? [JWT]? JWT are tokens that you can use in your web application to transfer data over a network and therefore authenticate communication between 2 parties. A better definition is: JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. – Source It is a hash like encrypted string
New project: Authentication from scratch
New project in progress… Vanilla JS project with: 3 Login strategies 2 password reset strategies Security precautions
Coding Worksheet # 5: OMG! Objects
OMG! Objects What are objects Objects are a data type. JavaScript follows an ‘object based paradigm’. Which means in JS an object is a stand-alone entity (object) with properties. Properties come in key: value pairs. They are like variables. In the sense that variables reference some value in memory. The same way, in objects the property key: value pairs are akin to variables. Why? Think
Newbie guide : socket.IO: Code a chat app – Part 2
Code a chat app Guide Introduction The features of the chat app Socket.IO methods Socket.IO events Callback functions Directory structure So far.. Set up index.html and style.css Sending a message from the client to the server Receiving the message from the client at the server Displaying the message to all connected clients Broadcasting “user is typing…” message Display greeting message when someone joins the chat
Coding worksheet #4: Callback functions
Just something I made as a primer. I’ve tried to condense as much information I could for ‘scoped’ learning [codepen_embed height=”300″ theme_id=”21517″ slug_hash=”ZRjGxr” default_tab=”html,result” user=”Kauress”]See the Pen You used to callback on my cellphone, code worksheet by Kauress (@Kauress) on CodePen.[/codepen_embed]
Day 5: JavaScript function to crash your browser
JavaScript function to crash your browser via an infinite loop [codepen_embed height=”300″ theme_id=”21518″ slug_hash=”bOJBee” default_tab=”js,result” user=”Kauress”]See the Pen <a href=’https://codepen.io/Kauress/pen/bOJBee/’>Day 5: JavaScript function to crash browser</a> by Kauress (<a href=’https://codepen.io/Kauress’>@Kauress</a>) on <a href=’https://codepen.io’>CodePen</a>.[/codepen_embed]
Day 4: Neural network in JavaScript with brain.js
Work in progress on codepen…
Day 3: Anonymous JavaScript function
Anonymous functions: “Anonymous functions are created at runtime. The function operator can be used anywhere that it’s valid to use an expression. For example you can use the function operator when a variable is being assigned, when a parameter is being passed to a function or in a return statement.” more @helephant [codepen_embed height=”411″ theme_id=”21518″ slug_hash=”MZzNZB” default_tab=”html,result” user=”Kauress”]See the Pen <a href=’https://codepen.io/Kauress/pen/MZzNZB/’>Day 3: Anonymous JavaScript