refs #6264 perf remove unnecessary code
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
a8b0a7a5b3
commit
a5fb07bf12
|
@ -1,16 +1,7 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
|
||||
module.exports = function(options) {
|
||||
return async function(req, res, next) {
|
||||
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