@universal-packages/express-controllers-authentication
TypeScript icon, indicating that this package has built-in type declarations

1.10.3 • Public • Published

Express Controllers Authentication

npm version Testing codecov

universal-authentication implementation on top of universal-express-controllers

Install

npm install @universal-packages/express-controllers-authentication

npm install @universal-packages/express-controllers

Global methods

initialize(options: Object)

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 { ExpressControllers } from '@universal-packages/express-controllers'
import { initialize } from '@universal-packages/express-controllers-authentication'

await initialize({ secret: 'my-secret' })

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>

Authentication Modules

Enabled authentication modules that provide a controllers will be enabled in express controllers if they are enabled in the authentication api. For example the default module provided by universal-authentication is enabled by default.

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

MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @universal-packages/express-controllers-authentication

Weekly Downloads

540

Version

1.10.3

License

MIT

Unpacked Size

46.3 kB

Total Files

39

Last publish

Collaborators

  • omarandstuff