Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Created April 4, 2020 19:04
Show Gist options
  • Save nemrosim/1227b7c1e8f111a76f0fa98788bac872 to your computer and use it in GitHub Desktop.
Save nemrosim/1227b7c1e8f111a76f0fa98788bac872 to your computer and use it in GitHub Desktop.
Auth config.js file for using JWT token
'use strict';
/** @type {import('@adonisjs/framework/src/Env')} */
const Env = use('Env');
module.exports = {
authenticator: 'jwt',
jwt: {
serializer: 'lucid',
model: 'App/Models/User',
scheme: 'jwt',
uid: 'email',
password: 'password',
options: {
secret: Env.get('APP_KEY'),
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment