Reformat session based authentication code samples

pull/2847/head
Kamran Ahmed 2 years ago
parent 9727a3daae
commit a70739bc4a
  1. 20
      content/guides/session-based-authentication.md

@ -85,9 +85,9 @@ module.exports = function HomeHandler(req, res) {
res.setHeader('Content-Type', 'text/HTML)
res.write(`
<h1>Welcome back ${req.session.userid}</h1>
<a href="/logout">Logout</a>
`);
<h1>Welcome back ${req.session.userid}</h1>
<a href="/logout">Logout</a>
`);
res.end()
}
@ -113,13 +113,13 @@ module.exports = function LoginHandler(req, res) {
res.setHeader('Content-Type', 'text/HTML)
res.write(`
<h1>Login</h1>
<form method="post" action="/process-login">
<input type="text" name="username" placeholder="Username" /> <br>
<input type="password" name="password" placeholder="Password" /> <br>
<button type="submit">Login</button>
</form>
`);
<h1>Login</h1>
<form method="post" action="/process-login">
<input type="text" name="username" placeholder="Username" /> <br>
<input type="password" name="password" placeholder="Password" /> <br>
<button type="submit">Login</button>
</form>
`);
res.end();
}

Loading…
Cancel
Save