#6264 - renewToken #1824
|
@ -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
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue
Porque la pasas a async? No tiene ningún await dentro
Tomo nota