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) {
|
module.exports = function(options) {
|
||||||
return async function(req, res, next) {
|
return async function(req, res, next) {
|
||||||
if (!req.accessToken) {
|
if (!req.accessToken)
|
||||||
const token = req.headers.authorization;
|
|
||||||
if (!token) return next();
|
|
||||||
|
|
||||||
const accessToken = await models.AccessToken.findById(token);
|
|
||||||
if (!accessToken) return next();
|
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
}
|
|
||||||
|
|
||||||
let LoopBackContext = require('loopback-context');
|
let LoopBackContext = require('loopback-context');
|
||||||
let loopbackContext = LoopBackContext.getCurrentContext();
|
let loopbackContext = LoopBackContext.getCurrentContext();
|
||||||
|
|
Loading…
Reference in New Issue