You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
'use strict'
/** @type {import('@adonisjs/framework/src/Env')} */
const Env = use('Env')
module.exports = {
/*
|--------------------------------------------------------------------------
| Authenticator
|--------------------------------------------------------------------------
|
| Authentication is a combination of serializer and scheme with extra
| config to define on how to authenticate a user.
|
| Available Schemes - basic, session, jwt, api
| Available Serializers - lucid, database
|
*/
authenticator: 'api',
/*
|--------------------------------------------------------------------------
| Session
|--------------------------------------------------------------------------
|
| Session authenticator makes use of sessions to authenticate a user.
| Session authentication is always persistent.
|
*/
session: {
serializer: 'LucidMongo',
model: 'App/Models/User',
scheme: 'session',
uid: 'email',
password: 'password'
},
/*
|--------------------------------------------------------------------------
| Basic Auth
|--------------------------------------------------------------------------
|
| The basic auth authenticator uses basic auth header to authenticate a
| user.
|
| NOTE:
| This scheme is not persistent and users are supposed to pass
| login credentials on each request.
|
*/
basic: {
serializer: 'LucidMongo',
model: 'App/Models/User',
scheme: 'basic',
uid: 'email',
password: 'password'
},
/*
|--------------------------------------------------------------------------
| Jwt
|--------------------------------------------------------------------------
|
| The jwt authenticator works by passing a jwt token on each HTTP request
| via HTTP `Authorization` header.
|
*/
jwt: {
serializer: 'LucidMongo',
model: 'App/Models/User',
scheme: 'jwt',
uid: 'email',
password: 'password',
expiry: '1m',
options: {
secret: Env.get('APP_KEY')
}
},
/*
|--------------------------------------------------------------------------
| Api
|--------------------------------------------------------------------------
|
| The Api scheme makes use of API personal tokens to authenticate a user.
|
*/
api: {
serializer: 'LucidMongo',
scheme: 'api',
model: 'App/Models/User',
uid: 'email',
password: 'password',
expiry: '30d',
},
}
zeeshanyshaikh
changed the title
Schema type api is not working, it showing error "Missing or Invalid Token"
Scheme type api is not working, it showing error "Missing or Invalid Token"
Jul 4, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
My auth.js looks like
My logout function uses auth middleware.
Now when i request this from Postman tool am getting error as "E_INVALID_API_TOKEN: The api token is missing or invalid"
Am using Mongo db, and i have generated token using attempt method while login
Am also passing bearer token in postman which i got from attempt method.
Still am getting same error that token is missing...please help me understand what is wrong here. Thanks.
The text was updated successfully, but these errors were encountered: