Apply suggestions from code review

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-02-01 18:13:37 +01:00
committed by GitHub
parent e2101e8892
commit c4473a314b
@@ -268,7 +268,7 @@ router.get('/read-data', (req, res) => {
#### Issuing a cookie and allowing user cookie auth on a separate endpoint
```ts
router.get('/cookie', (req, res) => {
router.get('/cookie', async (req, res) => {
await httpAuth.issueUserCookie(res); // If this is a service call it'll throw
res.json({ ok: true });
});
@@ -293,7 +293,7 @@ router.get(
httpAuth.middleware({ allow: ['user-cookie'] }),
(req, res) => {
// These credentials don't actually contain an underlying user token for cookie-authed requests
// You you try to pass them to the AuthService, it'll throw.
// If you try to pass them to the AuthService, it'll throw.
const { user } = httpAuth.credentials(req);
console.log(
`User ref=${user.userEntityRef} ownership=${user.ownershipEntityRefs}`,