#6264 - renewToken #1824

Merged
jsegarra merged 36 commits from 6264-renewToken into dev 2023-12-20 09:22:29 +00:00
1 changed files with 1 additions and 10 deletions
Showing only changes of commit a5fb07bf12 - Show all commits

View File

@ -1,16 +1,7 @@
const {models} = require('vn-loopback/server/server');
module.exports = function(options) {
return async function(req, res, next) {
jsegarra marked this conversation as resolved Outdated
Outdated
Review

Porque la pasas a async? No tiene ningún await dentro

Porque la pasas a async? No tiene ningún await dentro

Tomo nota

Tomo nota
if (!req.accessToken) {
const token = req.headers.authorization;
if (!token) return next();
const accessToken = await models.AccessToken.findById(token);
if (!accessToken) return next();
if (!req.accessToken)
return next();
}
let LoopBackContext = require('loopback-context');
let loopbackContext = LoopBackContext.getCurrentContext();