Skip to content

Task-5: Authentication#5

Open
aleksandra-sturova wants to merge 1 commit intomasterfrom
task-5
Open

Task-5: Authentication#5
aleksandra-sturova wants to merge 1 commit intomasterfrom
task-5

Conversation

@aleksandra-sturova
Copy link
Owner

No description provided.

const allowAccess = currentUserData && currentUserData.password === password;

if (allowAccess) {
const token = jwt.sign({ userName }, 'secret13', { expiresIn: 30 });

Choose a reason for hiding this comment

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

It would be better use secret from config file?)

const { userName, password } = req.body;

const currentUserData = users.find(user => user.userName === userName);
const allowAccess = currentUserData && currentUserData.password === password;

Choose a reason for hiding this comment

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

Adds check if ‘currentUserData’ not null, please

@vladislavkovaliov
Copy link

vladislavkovaliov commented Jun 19, 2018

Reads about https://expressjs.com/en/guide/error-handling.html and implements it, please
Header “The Default Error Handler”
Adds logging morgan, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants