How can setup a multiple auth and token system?

#1

Hello. In my application, I have two entities that need authentication. Each one with its particularities.

I have the normal user model with users table and token relationship. Users use session auth scheme. And I have de application model. An application uses API personal token for auth. But I want that my application tokens are saved in a different table that my user tokens are saved. How can I setup this with AdonisJS ?

auth.js

...
  session: {
    serializer: 'lucid',
    model: 'App/Models/User',
    scheme: 'session',
    uid: 'email',
    password: 'password'
  },

 api: {
    serializer: 'lucid',
    model: 'App/Models/Application',
    scheme: 'api',
    uid: 'domain',
    password: 'application_secret'
  }

I have seen these two links:

and…

0 Likes