Commit Graph

72 Commits

Author SHA1 Message Date
Laurence Tennant
2b6cf53d30 fix(users): Better MIME-type checking, remove image cropping library (#1589)
* Cropping remove, nicer UI

* Fix MIME-type checking, add image upload tests

* Change image config settings to uploads.profile.image to build a more
rational structure for configuring other types of uploads
2016-11-15 15:59:47 -08:00
Sujeeth
fb9d9d912c feat(user): add strict validations for username (#1574)
Idea proposed by @sparshy #1204
Suggestions, rules and tests from Trustroots @simison
Added validations on user server model
Added client side validations
Added relevant tests on user server tests
Added relevant tests on user e2e tests

Fixes #1204
2016-10-19 20:40:26 -07:00
Pierre Brisorgueil
ae638893b2 fix(users): test for usernameOrEmail (#1582) 2016-10-19 18:59:45 +03:00
mleanos
99e5803eae Fix client-side tests after removing <base/>
Fixes the client-side tests after the removal of the <base/> tag from
the main layout.

These fixes aren't ideal. At the moment, they will suffice. This comment
(https://github.com/angular-ui/ui-router/issues/212#issuecomment-60803437),
among others in that issue, led me to choose this method as the fix to
avoid having to change any other core code.
2016-10-10 17:11:25 -07:00
mleanos
c065246a23 Update path in tests
Updated tests to account for new "/" prefix in the path.
2016-10-10 16:05:10 -07:00
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
Sujeeth
607ed061e3 feat(core): add notification feedback with angular-ui-notification (#1532)
Added visual notification for user/article updates
angular-ui-notification config added to core client config
Notification idea from #369
2016-10-10 14:51:44 -07:00
shanavas
5725c449c7 Fix(Users): Remove redundant request body (#1554) 2016-10-09 12:00:47 +03: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
Michael Leanos
fa138045e6 Deprecated $http success/error promise methods (#1508)
Replaces the $http service calls with promise based methods
of the client-side UsersService for the following:
  Users Change Password
  Users Manage Social Accounts
  Users Password Forgot
  Users Password Reset
  Users Signup
  Users Signin

Modifies tests to reflect changes.

Closes #1479
2016-09-17 12:05:21 -07:00
Mikael Korpela
25c8a6044c fix(tests): Clean out .send() from tests (#1489)
Clean out commented `.send()` from user CRUD test.
2016-09-08 14:45:33 +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
shanavas
730cca76af fix(users): don't update secure profile fields (#1421)
* Fix(users): Don't update secure profile fields

Avoid updating secure fields as password, salt ..etc through
user profile update.

Fixes #1420

* Refactor variable name
2016-08-27 09:45:06 +03:00
Michael Leanos
b795ddc7cd feat(users): Edit Profile client controller tests (#1329)
Adds client-side tests for the Users Edit Profile client controller.

1) should have user context
2) should update the user profile
3) should set vm.error if error

Related #1283
2016-06-25 13:52:22 -07:00
Michael Leanos
4906611ccc fix(users): GitHub strategy missing email (#1250)
Fixes an issue with an empty/missing/null Email coming from GitHub's
OAuth call response.

Also, introduces the `sparse` index option on the User model's Email
field. This will ensure that we can have multiple User documents without
the Email field.

Adds a server-side User model test for the sparse index setting on the
email field.

Confirms that User documents without the email field are not indexed,
illustrating the sparse option on the schema's email field works
properly.

Added the dropdb task to the Gulp test:client & test:server tasks, to
ensure we have a clean database & that any indexes are rebuilt; this
will ensure any Schema changes (in this case the email index is rebuilt using
the sparse index option) are reflected when the database is started again.

Added a UPGRADE.md for tracking important upgrade information for our
user's to be aware of, when we introduce potentially breaking changes.

Included an explanation of the Sparse index being added, and how to apply it
to an existing MEANJS application's database.

Adds a script for dropping the `email` field's index from the User
collection.

Related #1145
2016-04-29 14:13:46 -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
Michael Leanos
4e9ad81ad2 Merge pull request #1246 from QiyuLi/fix/supoort_mongo_3.2
fix(core): Support WiredTiger engine errmsg format in MongoDB 3.2
2016-03-14 12:19:59 -07:00
Michael Leanos
4c89ce7e2d Merge pull request #1208 from itelo/users-styleguide
feat(users): Modify users module to implement style guidelines.
2016-03-14 11:46:41 -07:00
mleanos
b00498629c fix(core): Remove trailing slash from routes
Adds an angular $urlRouterProvider service Rule to the Core module
configuration, that removes any trailing slashes in the URL for all routes.

The Rule is defined in the core routes configuration. Thus, in order for
this to work on all routes in the application, we have to inject the Core
module into each client module, as a dependecy in the client.module
configuration. Otherwise, we'd have to define the Rule in each module's route
configuration individually.

Adds missing client-side route configuration tests.

Tests demonstrate that the various route configurations can handle a trailing
slash in the URL, and gets resolved to the correct client route.

Fixes #1075
2016-03-06 20:56:29 -08:00
IteloFilho
173b702f6a feat(users): Modify users module to implement style guidelines. 2016-03-06 12:21:51 -03:00
Qiyu Li
6265aaa7da fix(core): Support WiredTiger engine errmsg format in MongoDB 3.2
The new WiredTiger engine is introduced in MongoDB 3.2.
It changes the output errmsg format for violation of unique index.
This commit adds support for the new format.

Fixes #1245
2016-03-04 09:56:15 -05:00
Joris Willems
500d1a62df feat(config): upgrade to angular 1.5
Update bower dependencies to more recent versions.
Resolved hard-coded dependency by updating file upload
PhantomJs to 2.x series for tests (@usta)
Fix assertion in tests for compatibility with MongoDB 3.2 (@rhutchison)
Improve coding style tests to avoid type errors (@ilanbiala)
Fix refresh showing flash of scrollbar in menu
Remove deprecated angular-ui-utils

Fixes #1124
2016-03-02 18:18:53 +01:00
Ilan Biala
62095a1114 fix(test): Update Mocha, mock-fs, and fix Node 5 support 2016-02-10 20:47:11 -05:00
Joris Willems
9cd4ceca46 feat(config): Upgrade angular-bootstrap 0.13 to 1.0
Many issues arise when using angular-bootstrap 0.13. Migration to 1.0 is
straightforward, offers a more stable interface, extra directives and fixes
many bugs.
Migration guide:
https://github.com/angular-ui/bootstrap/wiki/Migration-guide-for-prefixes

Fixes #1142
Fixes #1131
2016-01-17 22:06:34 +01:00
jloveland
33258f1314 feat(users): Supporting valid email according to HTML5 and RFC 822
Supporting valid email (i.e. root@admin) according to HTML5 and RFC 822
proposed by @jloveland

Fixes #934
2015-11-30 21:47:13 -05:00
mleanos
a871c92556 Duplicate CRUD Test - Profile Picture
Removes a duplicate User CRUD test for Profile Picture.

There are two reasons for this commit.

1) Duplicate of
https://github.com/meanjs/mean/blob/master/modules/users/tests/server/user.server.routes.tests.js#L833-L848
2) This test is problematic in Windows environment.
Related to:
https://github.com/visionmedia/supertest/issues/230
https://github.com/visionmedia/supertest/issues/258

The latter may be an issue with the `.attach` method not completely
loading the file into memory before the 400 status response is sent back
due to no User logged in.
2015-10-28 22:57:28 -07:00
gustavodemari
7ecf9337ce updating profile upload with a new version of multer 2015-10-18 20:56:12 -02:00
Ilan Biala
cc486d54c5 Merge pull request #910 from jloveland/hide-password-validator
Hide the password strength progress when the field is empty
2015-10-16 23:34:55 -04:00
Ilan Biala
0323696eaf Format code according to ESLint rules 2015-10-16 20:52:31 -04:00
jloveland
65140442f0 adding tests for directives 2015-10-13 23:23:52 -04:00
Liran Tal
8a12f76a19 Merge pull request #972 from mleanos/mocha-global-timeout-grunt
Global Mocha timeout
2015-10-13 08:39:48 +03:00
Liran Tal
0017886d6e updating travis to support installing a local mail server 2015-10-11 23:19:20 +03:00
Liran Tal
eb7c4f8e91 adding more API tests 2015-10-11 23:19:20 +03: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
Liran Tal
3cfd978e8a Merge pull request #922 from lirantal/feature/travis-add-node-v4-gcc-update
NodeJS v4 support - fixing the failed build
2015-10-06 14:22:47 +03:00
Liran Tal
b7a57abd30 adding the required support to properly build the nodejs v4 edition
updating grunt-node-inspector version to compatible version with nodejs v4
2015-10-06 14:09:04 +03:00
Ilan Biala
7a9ee53357 Merge pull request #939 from jloveland/e2e-tests-fix
Fix grunt and gulp e2e tests, Fixes #929
2015-10-04 12:49:42 -04: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
Liran Tal
7fcd4f2ed3 Merge pull request #937 from lirantal/feature/seeddb-refactoring
SeedDB Refactoring
2015-09-30 12:55:49 +03:00
jloveland
fdf1ad571b fixing grunt and gulp e2e tests 2015-09-29 08:21:43 -04:00
Liran Tal
cc80930081 Merge pull request #904 from jloveland/jshint-single-quotes
fixing jshint single quotes issues
2015-09-28 23:47:13 +03:00
Liran Tal
988609399a refactoring the seeddb logic to work with promises all over due to all the async behavior 2015-09-28 11:29:39 +03:00
Ilan Biala
5901b17926 Merge pull request #901 from igorauad/fixRedirection
Fix redirection to previous state after required authentication
2015-09-26 14:18:40 -04:00
Liran Tal
b800141c41 Merge pull request #921 from mleanos/dbseed-user-passwords
[hotfix] Fixes db seed password bug
2015-09-25 08:37:40 +03:00
mleanos
1c7d74298b [hotfix] Fixes db seed password bug
Fixes the database seeding bug with the password not passing the owasp
test.

Adds a UserSchema static method that generates a random passphrase that passes
the owasp test.

Performed minor refactoring of the database seed configuration to
implement the new UserSchema method.

Added model test for the UserSchema generateRandomPassphrase static method.
2015-09-22 02:23:30 -07:00
Liran Tal
de354ee6d6 adding route tests for user/admin CRUD operations 2015-09-21 20:18:24 +03:00
Liran Tal
1eddc471db updating comments for tests in code 2015-09-20 18:35:52 +03:00
Igor Freire
2b8bee0c8c Fix redirection to previous state after required authentication
Fixes the issue with the previous state not being recorded, when the
unauthenticated user is redirected to the signin state, when trying to
access a restricted route.

Added a function that stores the provided state & state params, in the
$state.previous object. This has been implemented in the
$stateChangeSuccess event, and the callback of the $state.go transition
when the user is not allowed to access the requested route.
2015-09-19 16:34:17 -03:00
jloveland
a38abd0f8c fixing jshint issues by requiring single quotes 2015-09-11 12:47:19 -04:00
jloveland
1fd6bb6119 adding stronger password requirements for improving security based on OWASP 2015-09-07 22:11:02 -04:00