问题
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