This app is an attempt to amend the loopback-example-passport in a 2.x fashion (JSON+JS model files, no base models redefinition, etc)
UserIdentityandUserCredentialsplit- Put main models definitions (properties/relations) in JSON files, so they can be used in outer app with a single
models-config.jsdeclaration - Refactor of other files and tests to work with new architecture
- This app defines a specific
AppUserextending baseUsermodel, obviously passport component also work with the base model directly - I think that
Userbase model should be extendable without having to redefine loopback base relations to it- However, it does not work out of the box
- Hence why I redefine
AccessTokenrelations to customAppUserinboot/00_init.js - This would be nice to be taken care by
loopback access-token.jsdirectly, the same way it is done inPassportConfigurator.prototype.setupModels
- I added number prefix to
bootdirectory files a la Rc.d so the order is more readable- This is important because messing with the middleware order can actually break everything
- I tested with Facebook login only
- Please see the
providers.json.templateto specify your own keys - Please see original repo here for all info : https://github.com/strongloop/loopback-example-passport