Fix User model to preserve the current session (provided via
"options.accessToken") when invalidating access tokens after a change
of email or password property.
* 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)
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.
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.
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.
Operation hooks are inherited by subclassed models, therefore they must
be registered outside of `Model.setup()` function.
This commit fixes this problem in the built-in User model.
There are not tests verifying this change, as writing a test would be
too cumbersome and not worth the cost IMO.
Currently the return type of Role.getRoles() method is inconsistent:
role names are returned for smart roles and role ids are returned for
static roles (configured through user-role mapping).
This commit adds a new option to Role.getRoles() allowing the caller
to request role names to be returned for all types of roles.
- Fix for current implimentation that returned all models that had any
assigned roles. Context was not carried into listByPrincipalType,
setting roleId as null.
- Remove sign CLA since CI already shows unsigned CLAs
- Remove all tests must pass CI since we have to check each on a case by
case basis anyways
- Update example to include linking to the current repo using number
sign (ie. #49 in addition to org/repo#49)
Backport of #2877
* Reword ticking checkbox note in issue template (#2855) (Simon Ho)
* Add how to tick checkbox in issue template (#2851) (#2853) (Simon Ho)
* Use GitHub issue templates (#2810) (#2852) (Simon Ho)
* Allow tokens with eternal TTL (value -1) (Miroslav Bajtoš)
* Update ja and nl translation files (Candy)
* Fix support for remote hooks returning a Promise (Tim van der Staaij)
* Validate non-email property partial update (Loay)
* Update translation files - round#2 (Candy)
* Update tests to use registry for model creation (gunjpan)
* Call new disable remote method from model class. (Richard Pringle)
* Temporarily disable Karma tests on Windows CI (Miroslav Bajtoš)
* Add translation files for 2.x (Candy)
* Allow resetPassword if email is verified (Loay)
* Add docs for KeyValue model (Simon Ho)
* Invalidate sessions after email change (Loay)
* Upgrade loopback-testing to the latest ^1.4 (Miroslav Bajtoš)