Message from JavaScript discussions

November 2020

β€” I just wanna know how someone with experience should handle this

β€” 

You have no structure.. wrong, you have a structure you are trying to adapt, if you like it, ye, put everything in one huge pile🀀

β€” So best practice is to put each function in a seperate file

β€” And then call the file in the page where it belongs

β€” Not a function, but the js code which that page may use

β€” Yeah exactly

β€” Love you thanks

β€” Auth.ls from that project

"use strict"
window.addEventListener 'load', !->
# get nodes
nodeMap =
form: document.querySelectorAll '#auth form' .0
btnSubmit: document.querySelectorAll '#auth button' .0
roleName: document.querySelectorAll '#auth h3' .0
inputs: [...(document.querySelectorAll '#auth .input')]
switch: [...(document.querySelectorAll '#auth .switch svg')]
img: [...(document.querySelectorAll '#auth img')]
# ...

Message permanent page

β€” How to protect client side routes if I got a json web token from my API

β€” Like if I go to dashboard how do I verify if the user is logged in through the rest API

β€” You set header cookie and it is sent in every request, that's a session identifier of the user

β€” Yes but do you mean like a javascript cookie