Skip to content

Commit

Permalink
Update EXAMPLES.md
Browse files Browse the repository at this point in the history
Missing await on getSession call
  • Loading branch information
veth-tech authored Dec 6, 2022
1 parent 6310f55 commit 78d92d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Requests to `/pages/api/protected` without a valid session cookie will fail with
import { withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';

export default withApiAuthRequired(async function myApiRoute(req, res) {
const { user } = getSession(req, res);
const { user } = await getSession(req, res);
res.json({ protected: 'My Secret', id: user.sub });
});
```
Expand Down

0 comments on commit 78d92d1

Please sign in to comment.