new CustomModel based on access-token model with different primary key.
Description/Steps to reproduce
if create CustomModel based on AccessToken and set field "pk" as id field like this: { "name": "CustomModel", "plural": "accessTokens", "base": "AccessToken", "idInjection": true, properties": { "pk": { "type": "string", "id": true } }, then when user try to login, in function that creates new Token receive err:
In access-token.js : AccessToken.createAccessTokenId(function(err, id) { if (err) return next(err); ctx.instance.id = id; next(); }); });
Expected result
ctx.instance.pk - in ctx.
node_modules/loopback/common/models/access-token.js:76
ctx.instance.id = id;
^
TypeError: Cannot set property id of #
Additional information
darwin x64 8.1.2 ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.
How did you resolve this issue?
I haven't remembered already. Think, just removed pk field and start using id field as default. Sorry. (
how access token work