Loopback accessToken not persisted to database

橙三吉。 提交于 2019-12-11 03:47:10

问题


The access tokens created are not being persisted to the postgresql database. I created extended users and access_tokens models using the strongloop controller interface using the User and AccessToken models as parents. On login the user is successfully queried from the database, login is successful, and the access token is created. However the access token is not persisted in the database and so essentially the login fails.

Inside my model_config.json I have the following entries:

"access_tokens": {
  "dataSource": "postgresdb",
  "public": true
},
"users": {
  "dataSource": "postgresdb",
  "public": true
}

When investigating, the create function is called and the accessToken.beforeCreate() properly triggered and successfully returned. However the database does not store the token. When altering the access_tokens database to use db (memory) the access token created still cannot be used for authentication.

I am certain the database settings are correct because the access_tokens table is on the same db as the users and the users successfully grabs all the user information.

来源:https://stackoverflow.com/questions/27462545/loopback-accesstoken-not-persisted-to-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!