Skip to content

pandaiolo/loopback-example-passport-2.x

Repository files navigation

loopback-example-passport-2.x

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)

Main changes

  • UserIdentity and UserCredential 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

Notes

  • This app defines a specific AppUser extending base User 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 custom AppUser in boot/00_init.js
    • This would be nice to be taken care by loopback access-token.js directly, the same way it is done in PassportConfigurator.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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published