mirror of
https://github.com/ONLYOFFICE/server.git
synced 2026-04-07 14:04:35 +08:00
[linter] manual-fix after merge
This commit is contained in:
@ -1471,7 +1471,7 @@ exports.watchWithFallback = async function watchWithFallback(ctx, dirPath, fileP
|
||||
*/
|
||||
function getImpl(object, property) {
|
||||
//from https://github.com/node-config/node-config/blob/a8b91ac86b499d11b90974a2c9915ce31266044a/lib/config.js#L137
|
||||
var t = this,
|
||||
const _t = this,
|
||||
elems = Array.isArray(property) ? property : property.split('.'),
|
||||
name = elems[0],
|
||||
value = object[name];
|
||||
|
||||
@ -38,12 +38,10 @@ const tenantBaseDir = config.get('tenants.baseDir');
|
||||
// const isMultitenantMode = config.get('tenants.isMultitenantMode');
|
||||
const defaultTenantSecret = config.get('services.CoAuthoring.secret.browser.string');
|
||||
const filenameSecret = config.get('tenants.filenameSecret');
|
||||
const tenantManager = require('../../../../Common/sources/tenantManager');
|
||||
const jwt = require('jsonwebtoken');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const commonDefines = require('../../../../Common/sources/commondefines');
|
||||
|
||||
|
||||
const router = express.Router();
|
||||
@ -65,8 +63,8 @@ router.get('/me', async (req, res) => {
|
||||
try {
|
||||
const decoded = jwt.verify(token, defaultTenantSecret);
|
||||
res.json(decoded);
|
||||
return;
|
||||
} catch (defaultError) {
|
||||
|
||||
} catch {
|
||||
// If default secret fails, try to find the tenant and verify with their secret
|
||||
const tenantList = fs.readdirSync(tenantBaseDir);
|
||||
for (const tenant of tenantList) {
|
||||
@ -78,7 +76,7 @@ router.get('/me', async (req, res) => {
|
||||
isAdmin: decoded.isAdmin
|
||||
});
|
||||
return;
|
||||
} catch (tenantError) {
|
||||
} catch {
|
||||
// Continue to next tenant
|
||||
continue;
|
||||
}
|
||||
@ -93,7 +91,7 @@ router.get('/me', async (req, res) => {
|
||||
});
|
||||
|
||||
router.post('/login', async (req, res) => {
|
||||
let ctx = new operationContext.Context();
|
||||
const ctx = new operationContext.Context();
|
||||
ctx.initDefault()
|
||||
try {
|
||||
const { secret } = req.body;
|
||||
|
||||
@ -3,6 +3,8 @@ const globals = require('globals');
|
||||
const prettier = require('eslint-config-prettier');
|
||||
const {includeIgnoreFile} = require('@eslint/compat');
|
||||
const path = require('node:path');
|
||||
const react = require('eslint-plugin-react');
|
||||
const reactHooks = require('eslint-plugin-react-hooks');
|
||||
|
||||
const gitignorePath = path.resolve(__dirname, '.gitignore');
|
||||
|
||||
@ -65,5 +67,22 @@ module.exports = [
|
||||
'max-lines': ['warn', 5000]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['AdminPanel/client/**/*.{js,jsx}'],
|
||||
plugins: {react, 'react-hooks': reactHooks},
|
||||
languageOptions: {
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
parserOptions: {ecmaFeatures: {jsx: true}},
|
||||
globals: {...globals.browser, ...globals.es2022}
|
||||
},
|
||||
settings: {react: {version: 'detect'}},
|
||||
rules: {
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/jsx-uses-vars': 'error',
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn'
|
||||
}
|
||||
},
|
||||
prettier
|
||||
];
|
||||
|
||||
11836
npm-shrinkwrap.json
generated
11836
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,8 @@
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "9.16.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-react": "^7.37.2",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"express": "4.21.2",
|
||||
"globals": "15.12.0",
|
||||
"husky": "^9.1.7",
|
||||
|
||||
Reference in New Issue
Block a user