Closed anantab closed 6 years ago
@anantab In the core of framework, they tried to find the suitable authentication provider (which was set on config/auth) https://github.com/adonisjs/adonis-auth/blob/1.0.7/middleware/Auth.js#L29
So you just need to change the authenticator and it should work http://www.adonisjs.com/docs/3.2/authentication#_switching_between_authenticators
Closing since no response from the issue reporter and not actionable as well
how to add multiple authenticator
Im doing something like this:
jwt_customer: {
serializer: 'lucid',
model: 'App/Models/Customer',
scheme: 'jwt',
uid: 'email',
password: 'password',
options: {
secret: Env.get('APP_KEY')
}
},
jwt_user: {
serializer: 'lucid',
model: 'App/Models/User',
scheme: 'jwt',
uid: 'email',
password: 'password',
options: {
secret: Env.get('APP_KEY')
}
},
Then, Im trying to switch between authenticators as specified here: https://adonisjs.com/docs/4.1/authentication#_switching_authenticators
Is it possible to use same authentication scheme like session and have separate auth with multiple tables, for example for admin section and customer section. Or could it be session for admin and jwt for customer section?