This repository was archived by the owner on Oct 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1d09f7d
to
e7e447f
Compare
Closed
23b2f0f
to
46059b3
Compare
Otherwise you get a weird "password must be at least 6 characters" error if you enter a short password while logging in. With this patch users will just get the standard "wrong password" message instead.
1f2d767
to
f48bddf
Compare
e0f5457
to
e0a37c9
Compare
Sockets aren't converting from GuestConnection to AuthedConnection correctly yet, I think. |
this needs some more work but I'll merge now because this is going to be the next version anyway and i don't want to rebase it whenever I do something else |
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These patches move all request handling logic to controller functions. Route files now only map routes to controller functions. This is more similar to what Sooyou had set up before. When I pulled some "business logic" (like playlist handling) into core I dropped the controller files and called the core APIs straight from route files. This patch instead takes a few clues from https://github.com/KunalKapadia/express-mongoose-es6-rest-api and puts all logic into controllers, even if it's just a single function call. This makes it much clearer where the work happens (always in the
controllers/
directory).The second patch also removes most by-hand validation from controllers and instead uses the validation library Joi. Nice thing about Joi is that validators are written in the shape of the data you expect, so instead of doing
we can do
which makes it more obvious what the incoming data actually looks like. (Also, the former doesn't check that the
after
property is actually a valid MongoDB ObjectID, whilst the latter does, so it's more robust as well!)