CodeGenieApp / CodeGenieApp/serverless-express
Correct way to "do nothing"
Open
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 676
- PR merge metrics
- No merged PRs in 30d
Description
Hello, and first of all thanks for the very nice library :).
I have a simple use case, I want to authenticate using passport and if the user is authenticated, the function should do nothing. It will run as lambda@edge at `ViewerRequest` for cloudfront.
What is the correct way to do nothing, return or call one of the response methods (to set `200`, something like that)?
```javascript
// ... (passport / express setup)
app.get('*', (req, res) => {
if (req.isAuthenticated()) {
return; // What should come here?
} else {
res.redirect('/login');
}
})
```
Contributor guide
Assessment
This issue has not been assessed yet.