Skip to content

Commit c096d97

Browse files
committed
Rename heading
Prevent confusion with POST as an HTTP verb
1 parent 9c5f8a2 commit c096d97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nodeJS/authentication/session_based_authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ And edit the homepage to show a personalized greeting with a logout button (whic
275275
</html>
276276
```
277277
278-
### Handling post-login requests
278+
### Handling requests after login
279279
280280
As of now, our `GET /` route will always display the homepage and will crash if someone has not yet logged in! There would not be a cookie and therefore no session to deserialize, so `req.session` would contain a fresh session object without any user properties. We can write a middleware that checks `req.session` and if it has a user ID in it, we can use it to query the db and grab any user info we need, then continue to the homepage. Otherwise, the user is not authenticated and we can redirect to the login page.
281281
@@ -368,7 +368,7 @@ app.post("/signup", async (req, res, next) => {
368368
});
369369
```
370370
371-
We don't need to modify any of its options, as the defaults all meet the [password storage recommendations set by OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#introduction) (Open Worldwide Application Security Project). Now in our `POST /login` middleware, we can also use argon2 to verify the submitted password against the stored salted hash.
371+
We don't need to modify any of its options, as the defaults all meet the [password storage recommendations set by OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#introduction) (Open Worldwide Application Security Project). Now in our `POST /login` middleware, we can also use argon2 to verify the submitted password against the stored salted hash:
372372
373373
```javascript
374374
app.post("/login", async (req, res, next) => {

0 commit comments

Comments
 (0)