mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
chore: Fix some eslint issues in routers
/puter/packages/backend/src/routers/open_item.js 48:10 error Unexpected negating the left operand of 'instanceof' operator no-unsafe-negation /puter/packages/backend/src/routers/save_account.js 106:34 error 'get_user' is not defined no-undef /puter/packages/backend/src/routers/sign.js 37:10 error Unexpected negating the left operand of 'instanceof' operator no-unsafe-negation
This commit is contained in:
parent
0c0846eef9
commit
ca3f9a823d
@ -45,7 +45,7 @@ module.exports = eggspress('/open_item', {
|
||||
const subject = req.values.subject;
|
||||
|
||||
const actor = Context.get('actor');
|
||||
if ( ! actor.type instanceof UserActorType ) {
|
||||
if ( ! (actor.type instanceof UserActorType) ) {
|
||||
throw APIError.create('forbidden');
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
"use strict"
|
||||
const express = require('express');
|
||||
const router = new express.Router();
|
||||
const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user} = require('../helpers');
|
||||
const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user, get_user } = require('../helpers');
|
||||
const auth = require('../middleware/auth.js');
|
||||
const config = require('../config');
|
||||
const { Context } = require('../util/context');
|
||||
|
@ -34,7 +34,7 @@ module.exports = eggspress('/sign', {
|
||||
allowedMethods: ['POST'],
|
||||
}, async (req, res, next)=>{
|
||||
const actor = Context.get('actor');
|
||||
if ( ! actor.type instanceof UserActorType ) {
|
||||
if ( ! (actor.type instanceof UserActorType) ) {
|
||||
throw APIError.create('forbidden');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user