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)
UserIdentity
andUserCredential
split- Put main models definitions (properties/relations) in JSON files, so they can be used in outer app with a single
models-config.js
declaration - Refactor of other files and tests to work with new architecture
- This app defines a specific
AppUser
extending baseUser
model, obviously passport component also work with the base model directly - I think that
User
base 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
AccessToken
relations to customAppUser
inboot/00_init.js
- This would be nice to be taken care by
loopback access-token.js
directly, the same way it is done inPassportConfigurator.prototype.setupModels
- I added number prefix to
boot
directory 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.template
to specify your own keys - Please see original repo here for all info : https://github.com/strongloop/loopback-example-passport