Skip to main content

One post tagged with "JWT"

View All Tags

Express server with JWT authentication

· 10 min read
Matej Jelluš
IT enthusiast that loves to write code and trying new things. Currently working in Bratislava as CTO in Kontentino.

I needed to create a simple server, that would have one “public” route /login and other routes are available only for users with valid JWT token.

That means, the user is allowed to log into the system and then get any data from it. If he is not logged in and he tries to get some data, he only get an error message and 401 ( Unauthorized ) status code will be returned.