loopbackio / loopback-connector-elastic-search

Strongloop Loopback connector for Elasticsearch
MIT License
78 stars 56 forks source link

Cannot login, access token mapping broken #64

Closed pulkitsinghal closed 7 years ago

pulkitsinghal commented 7 years ago

Log shared by @aquid:

Unhandled error for request GET /api/MyModel/profile?id=AVlqFgCzgZDS4o0PX3Uf: AssertionError: token.created must be a valid Date
    at ModelConstructor.AccessToken.validate (/Users/xxx/yyy/node_modules/loopback/common/models/access-token.js:137:7)
pulkitsinghal commented 7 years ago

I don't understand how it was working until now. We can borrow the same strategy from other connectors which have converted from string to date and fix this.

  1. https://github.com/janober/loopback-connector-couchbase-expert/issues/1
  2. https://github.com/janober/loopback-connector-couchbase-expert/commit/535c4581ac808ce9736d449c0dd963d2340cdc30#diff-fe2b0cd5c2de811c9832f908ab354ff4R514
  3. https://github.com/janober/loopback-connector-couchbase-expert/commit/535c4581ac808ce9736d449c0dd963d2340cdc30#diff-fe2b0cd5c2de811c9832f908ab354ff4R537
pulkitsinghal commented 7 years ago

@aquid please submit a PR when you have it. Also a test if possible ;)

pulkitsinghal commented 7 years ago

released in v1.3.2