diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 8b80afa9d..91eba93cc 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -74,9 +74,9 @@ module.exports = { '@stylistic/keyword-spacing': 'warn', '@stylistic/linebreak-style': 'warn', '@stylistic/lines-between-class-members': ['warn', { enforce: [ - { blankLine: 'never', prev: 'field', next: 'field' }, - { blankLine: 'always', prev: '*', next: 'method' }, - ] }], + { blankLine: 'never', prev: 'field', next: 'field' }, + { blankLine: 'always', prev: '*', next: 'method' }, + ] }], '@stylistic/max-len': ['warn', { code: 120 }], '@stylistic/max-statements-per-line': 'warn', '@stylistic/multiline-ternary': ['warn', 'always-multiline'], diff --git a/routes/profile.vue b/routes/profile.vue index ae9e46b61..f3c013d63 100644 --- a/routes/profile.vue +++ b/routes/profile.vue @@ -165,7 +165,7 @@
@@ -175,10 +175,12 @@
{{ authenticator.payload }}
@@ -440,9 +442,9 @@ export default mainPronoun.extend({
case 'mfa_recovery':
return 'mobile';
default:
- return 'b:' + type;
+ return `b:${type}`;
}
- }
+ },
},
});
diff --git a/server/routes/admin.js b/server/routes/admin.js
index 64bf327fc..a3b46afb2 100644
--- a/server/routes/admin.js
+++ b/server/routes/admin.js
@@ -1,7 +1,7 @@
import { Router } from 'express';
import SQL from 'sql-template-strings';
import avatar from '../avatar.ts';
-import {buildDict, now, shuffle, handleErrorAsync, filterObjectKeys} from '../../src/helpers.ts';
+import { buildDict, now, shuffle, handleErrorAsync, filterObjectKeys } from '../../src/helpers.ts';
import allLocales from '../../locale/locales.ts';
import fs from 'fs';
import { caches } from '../../src/cache.js';
@@ -666,16 +666,16 @@ router.get('/admin/authenticators/:id', handleErrorAsync(async (req, res) => {
SELECT * FROM authenticators
WHERE userId = ${req.params.id}
ORDER BY id DESC
- `)).map(auth => {
+ `)).map((auth) => {
delete auth.userId;
- let payload = JSON.parse(auth.payload);
- auth.payload = typeof(payload) === 'string'
+ const payload = JSON.parse(auth.payload);
+ auth.payload = typeof payload === 'string'
? null
: filterObjectKeys(payload, ['id', 'email', 'name', 'instance', 'username']);
return auth;
- })
+ });
return res.json(authenticators);
}));
diff --git a/src/helpers.ts b/src/helpers.ts
index 17ea9bc94..5d3be744d 100644
--- a/src/helpers.ts
+++ b/src/helpers.ts
@@ -503,11 +503,11 @@ export const parseUserJwt = (token: string): string | JwtPayload | null => {
}
};
-export const filterObjectKeys = (obj: Record