Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'aticles' mispelled lead to routes not protected #15

Closed
rinn7e opened this issue Apr 12, 2019 · 1 comment
Closed

'aticles' mispelled lead to routes not protected #15

rinn7e opened this issue Apr 12, 2019 · 1 comment

Comments

@rinn7e
Copy link

rinn7e commented Apr 12, 2019

While playing with nestjs realworld, I found out that you can create post without user authenticated due to misspelled aticles in article.module.ts https://github.com/lujakob/nestjs-realworld-example-app/blob/master/src/article/article.module.ts#L24-L27

Due to this.userRepository.findOne(userId) where userId is null, return the first user instead of throwing an error, it doesn't help detecting that the user does not exist.

I recommend using this.userRepository.findOne({ where: { id: userId } });
See this TypeORM issues: typeorm/typeorm#2500

@lujakob
Copy link
Owner

lujakob commented Apr 15, 2019

Thanks @rinn7e !! I fixed it.

@lujakob lujakob closed this as completed Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants