Commit Graph

20 Commits

Author SHA1 Message Date
Michael Leanos
0ea8cec120 fix(express): Incorrest uses of 400 error codes (#1553)
Fixes incorrest usage of 400 HTTP responses being returned from the
server, in favor of using 422.

Also, changed a few return codes to 401 where it was more appropriate.

See this article for reasoning behind moving to 422, and why 400 isn't
appropriate for these cases.

For ref:
6be12f8a06

Related:
https://github.com/meanjs/mean/pull/1547
https://github.com/meanjs/mean/pull/1510
2016-10-10 16:00:24 -07:00
itelo
6a6b630292 feat(users): change username to usernameOrEmail in signin (#1545)
* feat(users): change username to usernameOrEmail in signin

* fix(users): toLowerCase at email in local strategy
2016-10-06 18:34:15 +03:00
Mikael Korpela
c35713d352 fix(core): Fixes issues with tests and Node v6 (#1458)
Fixes issues with Mocha tests and Node v6.

Related to #1455
2016-08-28 14:30:27 +03:00
Michael Leanos
89075cb8d3 feat(articles): Article Admin feature (#807)
This feature introduces a breaking change, that restricts the User's that
can create/edit/delete Articles to only those that have the `admin` Role.

Fixed ESLint issues.

Resolved merge conflicts, and moved new client Article Service
`createOrUpdate` functionality to new Admin feature controller.

Removed edit functionality from client-side Article controller.
2016-07-25 17:34:06 -07:00
Marek Grzybek
d14d5130af feat(config): Deprecate JSHint in favor of ESLint
Add basic ESLint setup extending well-known Airbnb code style.

Fixes #1072, #1097
2016-03-15 19:11:12 +01:00
mleanos
69b8a05ea2 fix(articles): Article edit/delete validation
Adds a custom field named `isCurrentUserOwner` to the Article document before
it's returned to the client. This field is used to determine if the current
User should is the "owner", and should see the edit/delete controls on the
client-side when viewing a single article. This custom (ad-hoc) field is NOT
persisted to the database; it's merely attached to the document.

Added server-side route tests for verifying the ad-hoc
"isCurrentUserOwner" field is properly set on the a single Article document.

Fixes #1146
2016-02-07 21:29:18 -08:00
mleanos
2bdde4e9e2 fix(articles): Orphaned User reference throws server error
Adds an additional check for the existence of a populated user
reference, when determining if the current user has immediate access to
the requested article.

Without this fix, the server will throw an error if the requested
article doesn't have a populated user field.

Modified the article & articles list view's to check if the article has
a populated user. If not, then it will display "Deleted User" in place
of the missing user reference.

Added a server-side test that ensures we can get a single article if
the article.user field is referencing a deleted user.

Fixes #1082
2015-12-21 19:40:25 -08:00
mleanos
037878b4ba Global Mocha timeout
Added the timeout option to the Mocha grunt task; set to 10000.

Removed the individual test suite timeouts, for all server tests.

Also, added global timeout for Mocha gulp task.
2015-10-10 23:52:08 -07:00
mleanos
3b375e62d8 Mocha test timeouts [fixes #955]
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in https://github.com/meanjs/mean/issues/955
2015-09-30 19:50:07 -07:00
jloveland
1fd6bb6119 adding stronger password requirements for improving security based on OWASP 2015-09-07 22:11:02 -04:00
Liran Tal
7252032007 Adding coverage report for server-side tests using istanbul 2015-08-16 00:19:52 +03:00
Ryan Hutchison
ef3a3f9548 formatting reboot (space-2 and consistency)
JSCS fixes

update editorconfig
2015-07-31 10:04:02 -04:00
Sebastien Vaucouleur
71167b0e75 The article middleware was calling getErrorMessage with a null argument, causing a crash when this method tried to access 'code' on an null parameter.
The bug was not exposed by the original test, since it was mixing two (related) aspects:

* An invalid Id (a badly formed mongodb identifier)
* An non-existent Id (an identifier with no corresponding document in the database)

Modifications:

- Fixed the message property in the article controller (the error message follows the wording of the error message in "users.password.server.controller.js", in case of username not found)
- Added a new test to check modifications and avoid regressions
2015-07-28 11:11:10 +02:00
Cody B. Daig
a8dae99173 Remove console.log from an article test 2015-07-20 10:04:45 -07:00
Ilan Biala
ade074cf37 Merge pull request #599 from loulin/0.4.0
Add return for done(err) in test
2015-07-09 13:32:27 -04:00
Ryan Hutchison
67e38aec01 fix failing tests 2015-07-07 10:22:21 -04:00
Liran Tal
67e96a4f22 0.4.0 branch merged into master 2015-07-02 12:08:09 +03:00
loulin
d00f4ce0cc should return done(err) in article server route test 2015-06-30 11:15:52 +08:00
Veikko Karsikko
1897ef985b Wait for async saving and removing 2015-02-23 09:33:26 +02:00
Amos Haviv
ab81d61bd3 New 0.4 version 2014-11-10 23:12:33 +02:00