Auth Module
1.0.0
1.0.0
  • README
  • docs
    • providers
      • GitHub
      • Google
      • Auth0
      • Laravel Passport
      • Facebook
    • Auth Module
    • Migration Guide
    • guide
      • Middleware
      • Providers
      • Setup
      • Schemes
    • recipes
      • Extending Auth plugin
    • api
      • API
      • options
      • storage
      • auth
    • schemes
      • Local
      • Oauth2
    • glossary
  • .github
    • ISSUE_TEMPLATE
  • CHANGELOG
Powered by GitBook
On this page
  1. docs
  2. guide

Schemes

Schemes define authentication logic. Strategy is a configurated instance of Scheme. You can have multiple schemes and strategies in your project.

auth.strategies option is an object. Keys are strategy name and values are configuration.

auth: {
  strategies: {
    local: { /* ... */ },
    github: { /* ... */ },
  }
}

By default, instance names are the same as scheme names. If you want more flexibility by providing your own scheme or having multiple instances of the same scheme you can use the _scheme property:

auth: {
  strategies: {
    local1: { _scheme: 'local', /* ... */ },
    local2: { _scheme: 'local', /* ... */ },
    custom: { _scheme: '~/app/customStrategy.js', /* ... */ },
  }
}
PreviousSetupNextrecipes

Last updated 5 years ago