@universal-packages/express-controllers-authentication v1.7.1
Express Controllers Authentication
universal-authentication implementation on top of universal-express-controllers
Install
npm install @universal-packages/express-controllers-authentication
npm install @universal-packages/express-controllers-parameters
npm install @universal-packages/express-controllers
npm install express
Global methods
initialize(options: Object, [authenticatableClass: AuthenticatableClass])
Initialize the authentication api and the authentication controller to prepare routing configuration before the ExpressControllers
runs. The authentication controller is loaded automatically by ExpressControllers
.
import { initialize } from '@universal-packages/express-controllers-authentication'
import { ExpressControllers } from '@universal-packages/express-controllers'
import User from './User'
await initialize({ secret: 'my-secret' }, User)
const app = new ExpressControllers({ port: 3000 })
await app.prepare()
await app.run()
Now all authentication actions are available to access on path authentication/<action>
Options
initialize
takes the same options as Authentication
.
Additionally takes the following ones:
rootPath
String
default: /authentication
You can set the root of all authentication routes, ex:/auth/<action>
routes
connectProvider
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: connect-provider
Enables the customization of the route for this actionmethod
HTTPVerb
default: PATCH
Lets customize the method to access this action
continueWithProvider
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: continue-with-provider
Enables the customization of the route for this actionmethod
HTTPVerb
default: POST
Lets customize the method to access this action
invite
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: invite
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
logIn
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: log-in
Enables the customization of the route for this actionmethod
HTTPVerb
default: POST
Lets customize the method to access this action
logOut
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: log-in
Enables the customization of the route for this actionmethod
HTTPVerb
default: DELETE
Lets customize the method to access this action
me
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: log-in
Enables the customization of the route for this actionmethod
HTTPVerb
default: GET
Lets customize the method to access this action
requestConfirmation
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: request-confirmation
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
requestCorroboration
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: request-corroboration
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
requestMultiFactor
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: request-multi-factor
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
requestPasswordReset
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: request-password-reset
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
requestUnlock
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: request-multi-factor
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
sessions
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: log-in
Enables the customization of the route for this actionmethod
HTTPVerb
default: GET
Lets customize the method to access this action
signUp
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: sign-up
Enables the customization of the route for this actionmethod
HTTPVerb
default: POST
Lets customize the method to access this action
updateAuthenticatable
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: update-authenticatable
Enables the customization of the route for this actionmethod
HTTPVerb
default: PATCH
Lets customize the method to access this action
updateCredential
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: update-credential
Enables the customization of the route for this actionmethod
HTTPVerb
default: PATCH
Lets customize the method to access this action
updateSessionDeviceId
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
Enables the customization of the route for this actionmethod
HTTPVerb
default: PATCH
Lets customize the method to access this action
verifyConfirmation
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: verify-confirmation
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
verifyCorroboration
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: verify-corroboration
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
verifyMultiFactor
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: verify-multi-factor
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
verifyPasswordReset
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: verify-password-reset
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
verifyUnlock
enable
Boolean
default: true
Enables the controller to expose this actionpath
String
default: verify-unlock
Enables the customization of the route for this actionmethod
HTTPVerb
default: PUT
Lets customize the method to access this action
Typescript
This library is developed in TypeScript and shipped fully typed.
Contributing
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.
License
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
8 months ago
7 months ago
8 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
11 months ago
11 months ago
11 months ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago