resolve-auth
Provides an authentication mechanism using Passport authentication strategy.
Usage
First of all, create file with your strategy and add auth
section into config.app.json
for your application (see hacker-news
example).
Next, choose a type of authentication strategy (see passport-local or passport-google-oauth ) and define options of it.
Create your strategy in strategyConstructor
function using options
.
Return an array of tuples { strategy, options }
for every used route in your app.
Examples
Here is the simple example of local
strategy, but you can use any other Passport strategy similarly.
const options = routes const strategyConstructor = ...optionsstrategy passReqToCallback: true async { try catch error } options strategyConstructor