How to Repl Auth Express.js
Coder100 (19280)

How to use the Authentication API with express.js



code, example


@mat1 Has made an epic tutorial on how to use authentication!
Sadly... it is with and no offense, but python is pretty hard to use.
That's why I use express.js with node.js!

So, here's my tutorial:

You do what @mat1 did, but different:

I used pug to achieve the same results, and instead of request.headers, you use request.get().

Try logging in!

Examine the code here:

There's really not much more to say.

Read @mat1's tutorial and examine my code. Upvote if it worked for you and you could understand the code!

Deriving the API

If you go to Mozilla Firefox, open the repl auth website and type in a random domain, then click on inspect elements, and go to the network tab, fill in the form, you will see something interesting indeed. To get all that interesting headers, you will have to reload the page, as that is how you usually do anything that required updating. Well anyways, the rest is pretty self explanatory but I had to go to the documentation to learn how to use res.get().

How the code works

Pretty self explanatory, but if you want to know the gist of it, here you go.


If you have any more questions, please comment below with your question!

Pictures and summary

Example of data:

Summary: View the code here. Live working example here

Be sure to vote up this tutorial if you liked it!

You are viewing a single comment. View All
MahadKalam (0)

@Coder100 like, couldn't you change X-Replit-User-Name or the other headers to authenticate as someone else?