Commit Graph

1901 Commits

Author SHA1 Message Date
Raymond Feng cfb0148e53 Fix file patch 2017-03-17 08:46:35 -07:00
Miroslav Bajtoš 85c81f760c Merge pull request #3280 from strongloop/coveralls-2x
Add nyc coverage, report data to coveralls.io
2017-03-14 14:20:40 +01:00
Miroslav Bajtoš 4713e5e7ea
Add nyc coverage, report data to coveralls.io 2017-03-14 13:42:15 +01:00
Miroslav Bajtoš 45284c3bf9
2.38.1
* Fix User.verify to convert uid to string (phairow)
 * Configure Travis CI to cache phantomjs binaries (Miroslav Bajtoš)
 * Improve "filter" arg description (Raymond Camden)
 * Fix creation of verification links (Miroslav Bajtoš)
 * Include link to docs in logoutSessions warning (Miroslav Bajtoš)
 * Fix detection of logoutSessionsOnSensitiveChanges (Miroslav Bajtoš)
 * Preserve sessions on User.save() making no changes (Miroslav Bajtoš)
 * Remove unused dependencies (Miroslav Bajtoš)
 * Fix logout to handle no or missing accessToken (Ritchie Martori)
 * Use English when running Mocha tests (Miroslav Bajtoš)
 * Role model: resolves related models by name (Benjamin Kroeger)
 * Fix User methods to use correct Primary Key (Aris Kemper)
2017-03-13 16:22:17 +01:00
Miroslav Bajtoš 989c3bba1f Merge pull request #3259 from strongloop/backport/fix-verifyHref-uid
Fix User.verify to convert uid to string
2017-03-09 08:57:02 +01:00
phairow 91502db9f1
Fix User.verify to convert uid to string
Applications using MongoDB connectors typically have `user.id`
property of type ObjectID.

This commit fixes the code building the verification URL to
correctly convert the user id value into string.
2017-03-08 16:30:01 +01:00
Miroslav Bajtoš 10fddb64f7 Merge pull request #3222 from strongloop/backport/cache-phantomjs-on-travis
Configure Travis CI to cache phantomjs binaries [2.x]
2017-02-23 11:52:48 +01:00
Miroslav Bajtoš e334884fb1
Configure Travis CI to cache phantomjs binaries
This should speed up our CI builds and also save a lot of bandwidth
for people providing phantomjs-prebuilt module.

See also
https://www.npmjs.com/package/phantomjs-prebuilt#continuous-integration
2017-02-22 15:34:28 +01:00
Miroslav Bajtoš 68d55b523e Merge pull request #3219 from strongloop/backport/fix-filter-desc
Improve "filter" arg description
2017-02-21 17:28:51 +01:00
Raymond Camden a4154caf59
Improve "filter" arg description
Add an example showing how to serialize object values as JSON.
2017-02-21 15:00:57 +01:00
Miroslav Bajtoš 42780567a8 Merge pull request #3195 from strongloop/backport/fix-hash-path-in-redirect
Fix creation of verification links
2017-02-09 15:20:52 +01:00
Miroslav Bajtoš 09b1fce34b Fix creation of verification links
Fix User.prototype.verify to call `querystring.stringify` instead
of concatenating query-string components directly.

In particular, this fixes the bug where `options.redirect` containing
a hash fragment like `#/home?arg1=value1&arg2=value2` produced incorrect
URL, because the `redirect` value was not correctly encoded.
2017-02-09 13:33:57 +01:00
Miroslav Bajtoš 4e8252afad Merge pull request #3193 from strongloop/add-doc-url-for-logoutSession
Include link to docs in logoutSessions warning
2017-02-09 13:30:12 +01:00
Miroslav Bajtoš 8c76d7fc01 Include link to docs in logoutSessions warning 2017-02-08 09:02:39 +01:00
Miroslav Bajtoš 322f6c12bb Merge pull request #3167 from strongloop/backport/fix-token-invalidation-on-save
Preserve sessions on User.save() making no changes
2017-01-31 16:46:09 +01:00
Miroslav Bajtoš 0cc2b5b8db Fix detection of logoutSessionsOnSensitiveChanges
Modify the code detecting whether logoutSessionsOnSensitiveChanges
is enabled to correctly handle the case when the model is not attached
to any application, as is the case with loopback-component-passport
tests.
2017-01-31 15:53:41 +01:00
Miroslav Bajtoš 05db4337cf Preserve sessions on User.save() making no changes 2017-01-31 14:43:24 +01:00
Miroslav Bajtoš 50743e94be Merge pull request #3162 from strongloop/remove-unused-deps
Remove unused dependencies
2017-01-31 09:29:15 +01:00
Miroslav Bajtoš 6a4198896f Remove unused dependencies
- strong-error-handler
 - eslint

These dependencies were most likely added accidentally by fea3b781.
2017-01-30 15:09:59 +01:00
Miroslav Bajtoš 03391f7b00 Merge pull request #3158 from strongloop/backport/fix-logout-without-token
Fix logout to handle no or missing accessToken
2017-01-30 11:03:39 +01:00
Ritchie Martori 1dac9ada0b Fix logout to handle no or missing accessToken
Return 401 when the request does not provide any accessToken argument
or the token was not found.

Also simplify the implementation of the `logout` method to make only
a single database call (`deleteById`) instead of `findById` + `delete`.
2017-01-30 10:39:40 +01:00
Miroslav Bajtoš 2ade55ec03 Merge pull request #3148 from strongloop/backport/fix-language-in-tests
Use English when running Mocha tests
2017-01-27 13:10:49 +01:00
Miroslav Bajtoš 98110f1b84 Use English when running Mocha tests 2017-01-27 11:26:24 +01:00
Miroslav Bajtoš 97f96f4ab8 Merge pull request #3135 from strongloop/backport/fix-role-models-resolution
Role model: resolve related models by name
2017-01-25 16:23:48 +01:00
Benjamin Kroeger 56ad85ae2a Role model: resolves related models by name
Resolve models related to the `Role` model by name instead of class.
2017-01-25 11:02:55 +01:00
Miroslav Bajtoš b2a00286a3 Merge pull request #3129 from strongloop/backport/fix-user-id
Fix User methods to use correct Primary Key
2017-01-23 10:59:11 +01:00
Aris Kemper 5e7e7ca7e9 Fix User methods to use correct Primary Key
Do not use hard-coded "id" property name, call `idName()` to get the
name of the PK property.
2017-01-23 09:51:41 +01:00
Miroslav Bajtoš 6fcb7dba6a 2.38.0
* Add app setting logoutSessionsOnSensitiveChanges (Miroslav Bajtoš)
 * Fix User.resetPassword to call createAccessToken() (João Ribeiro)
2017-01-20 15:10:26 +01:00
Miroslav Bajtoš b541c5bff8 Merge pull request #3109 from strongloop/fix/flag-to-invalidate-tokens
Add app setting logoutSessionsOnSensitiveChanges
2017-01-20 15:09:08 +01:00
Miroslav Bajtoš f1e31ca50c Add app setting logoutSessionsOnSensitiveChanges
Disable invalidation of access tokens by default to restore backwards
compatibility with older 2.x versions.

Add a new application-wide flag logoutSessionsOnSensitiveChanges
that can be used to explicitly turn on/off the token invalidation.

When the flag is not set, a verbose warning is printed to nudge the user
to make a decision how they want to handle token invalidation.
2017-01-20 12:57:23 +01:00
Miroslav Bajtoš f355f66114 Merge pull request #3123 from strongloop/backport/fix-user-reset-password
Fix User.resetPassword to call createAccessToken()
2017-01-20 12:55:21 +01:00
João Ribeiro b8f9b85609 Fix User.resetPassword to call createAccessToken()
This allows User subclasses to override the algorithm used for building
one-time access tokens for password recovery.
2017-01-20 10:59:46 +01:00
Miroslav Bajtoš d35e1a1b6f 2.37.1
* Preserve current session when invalidating tokens (Miroslav Bajtoš)
 * Clean up access-token-invalidation tests (Miroslav Bajtoš)
2017-01-16 12:00:57 +01:00
Miroslav Bajtoš c7d07b6600 Merge pull request #3103 from strongloop/backport/preserve-current-access-token
Preserve current session when invalidating tokens
2017-01-16 12:00:08 +01:00
Miroslav Bajtoš afd6dd7073 Preserve current session when invalidating tokens
Fix User model to preserve the current session (provided via
"options.accessToken") when invalidating access tokens after a change
of email or password property.
2017-01-16 11:02:29 +01:00
Miroslav Bajtoš f8b013dab8 Clean up access-token-invalidation tests 2017-01-16 10:39:49 +01:00
Miroslav Bajtoš dc2b6530b7 2.37.0
* Emit resetPasswordRequest event with options (Sergey Reus)
 * Fix false emailVerified on user model update (박대선)
 * Add new flag injectOptionsFromRemoteContext (Miroslav Bajtoš)
 * Contextify DAO and relation methods (Miroslav Bajtoš)
 * Implement new http arg mapping optionsFromRequest (Miroslav Bajtoš)
 * Fix package.json CI downstreamIgnoreList nesting (David Cheung)
2017-01-09 12:58:30 +01:00
Miroslav Bajtoš f64721a447 Merge pull request #3073 from strongloop/backport/resetPasswordRequest-options
Emit resetPasswordRequest event with options
2017-01-05 16:00:09 +01:00
Sergey Reus 5233dcb557 Emit resetPasswordRequest event with options 2017-01-05 15:36:01 +01:00
Miroslav Bajtoš 0caee53f6b Merge pull request #3072 from strongloop/backport/email-verified-fix
Fix false emailVerified on user model update
2017-01-05 11:38:16 +01:00
박대선 659e9ce09b Fix false emailVerified on user model update
We noticed that every time the user model updates, the emailVerified
column would change to false, even though the email was not changed
at all.

I took a look and realized there might be an error in
https://github.com/strongloop/loopback/commit/eb640d8

The intent of the commit just mention is to make emailVerified false
when the email gets changed, but notice that ctx.data.email is null
on updates, so the condition is always met and emailVerified always
becomes false.

This commit fixes the issue just mentioned.
2017-01-05 11:08:35 +01:00
Miroslav Bajtoš 6e3fc24121 Merge pull request #3048 from strongloop/backport/options-from-context-2x
Inject remoting context to options arg
2017-01-05 10:58:46 +01:00
Miroslav Bajtoš 74bb1daf8a Add new flag injectOptionsFromRemoteContext
Hide the new "options" arguments behind a feature flag
injectOptionsFromRemoteContext that is disabled by default for backwards
compatibility.

Fix construction of sharedCtor remoting metadata to prevent the
situation when we are configuring remoting metadata after
strong-remoting has already picked up data from our parent (base) model.
2017-01-05 10:18:56 +01:00
Miroslav Bajtoš 693d52fc59 Contextify DAO and relation methods
Modify remoting metadata of data-access methods in PersistedModel
and relation method in Model and add an "options" argument to "accepts"
list.
2017-01-05 10:18:56 +01:00
Miroslav Bajtoš ee106e4e15 Implement new http arg mapping optionsFromRequest
Define a new Model method "createOptionsFromRemotingContext" that allows
models to define what "options" should be passed to methods invoked
via strong-remoting (e.g. REST).

Define a new http mapping `http: 'optionsFromRequest'` that invokes
`Model.createOptionsFromRemotingContext` to build the value from
remoting context.

This should provide enough infrastructure for components and
applications to implement their own ways of building the "options"
object.
2017-01-05 10:18:56 +01:00
David Cheung 65a3a0b110 Merge pull request #3067 from strongloop/fix-packagejson-wrong-ci-config
Fix package.json CI downstreamIgnoreList nesting
2017-01-03 17:05:40 -05:00
David Cheung d53d069763 Fix package.json CI downstreamIgnoreList nesting
in packge.json strongloop/loopback#3000 ci should be a root element
instead of under config:ci
2017-01-03 15:23:57 -05:00
Simon Ho 9c3d596106 2.36.2
* Add option disabling periodic change rectification (kobaska)
 * Release LTS LB2 (Simon Ho)
 * Invalidate AccessTokens on password change (Miroslav Bajtoš)
 * Fix registration of operation hooks in User model (Miroslav Bajtoš)
 * Remove "options.template" from Email payload (Miroslav Bajtoš)
 * Opt-out downstream builds that are unstable (David Cheung)
 * Allow password reset request for users in realms (Bram Borggreve)
 * Add "returnOnlyRoleNames" option to Role.getRoles (Eric)
 * Fix context within listByPrincipalType role method (codyolsen)
 * Add templateFn option to User#verify() (Adrien Kiren)
 * Add options to bulkUpdate (Kogulan Baskaran)
 * Require verification after email change (Loay)
 * adding check of string for case insensitive emails (Dhaval Trivedi)
 * Fix PR template to not link all PRs to #49 (#2887) (Miroslav Bajtoš)
2016-12-21 17:54:34 -08:00
Miroslav Bajtoš 18a89e556a Merge pull request #2960 from kobaska/avoid-cleanup
Avoid periodic cleanup/rectification of changes
2016-12-21 16:13:27 +01:00
kobaska b3a5bc739b Add option disabling periodic change rectification
When `Model.settings.changeCleanupInterval` is set to a negative value,
no periodic cleanup is performed at all.
2016-12-21 15:39:08 +01:00