How can setup a multiple auth and token system?

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 ?


  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:


1 Like

Hi Juhguu,

I have the same issue. Did you happen to solve your problem? If so, could you let me know what you did to resolve it?