Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Fix/radu/auth middleware #54

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

raduitache
Copy link
Contributor

No description provided.

@raduitache raduitache added the enhancement New feature or request label May 9, 2020
@raduitache raduitache requested a review from procateodor May 9, 2020 12:10
@raduitache raduitache self-assigned this May 9, 2020
@raduitache
Copy link
Contributor Author

Replace auth middleware.

routes/index.js Outdated
Comment on lines 20 to 24
db.Secret.findOne({ env: process.env.NODE_ENV, key: 'JWT_KEY' }, (err, secret) => {
if (err) return console.log(err)
const key = new Cryptr(process.env.SECRET_KEY).decrypt(secret.value)
router.use(jwtAuth.requireAuth(key))
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is ok, instead of config object. Which one should be used in this case, @procateodor ?

Copy link
Member

@procateodor procateodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 comment

@raduitache raduitache requested a review from procateodor May 11, 2020 16:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants