I want to build an API, using Google auth (via the loopback-component-passport) and ACL for access control. I also need to extend the standard User model, as I have some additional data fields.
By default the User
, AccessToken
, ACL
, RoleMapping
and Role
models use the in-memory storage, i.e. data will be lost once the app restarts. So, my questions are:
To persist data to MySQL, I would need to
automigrate
these models from in-memory to MySQL data source. But, if I'm going to extend theUser
model asStaffUser
, do I need to have tables for bothUser
andStaffUser
in the DB? Or, do I then keepUser
in-memory andStaffUser
in MySQL?The passport component adds its own models (
UserIdentity
,UserCredential
,ApplicationCredential
,PassportConfigurator
). Would there be any reason to persist these in MySQL, or do I keep these in-memory?