June 2025
Intermediate to advanced
837 pages
24h 50m
English
The local strategy used in this example requires users to enter their user name and password and send both to the server via a POST request. To do this, you first need a login form.
Because the login form is a purely static page, you can save the necessary source code in the public directory of your application in the login.html file.
The form in Listing 9.3 is an ordinary HTML form sent to the server via POST request to the /login path. Based on the standard requirements of the local strategy, the user name is submitted as username and the password as password.
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <link rel="stylesheet" href="style.css" ...
Read now
Unlock full access