summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-02-28 09:34:21 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-02-28 09:34:21 +0900
commitc63c3462dd00e7de3f40b15ad43993a26734263f (patch)
tree959d9b753059e66e813ab3b8fe74e4975acbc32d /packages/backend/src/misc
parent[skip ci] Update CHANGELOG.md (prepend template) (diff)
downloadsharkey-c63c3462dd00e7de3f40b15ad43993a26734263f.tar.gz
sharkey-c63c3462dd00e7de3f40b15ad43993a26734263f.tar.bz2
sharkey-c63c3462dd00e7de3f40b15ad43993a26734263f.zip
refactor
Diffstat (limited to 'packages/backend/src/misc')
-rw-r--r--packages/backend/src/misc/is-native-token.ts7
-rw-r--r--packages/backend/src/misc/token.ts (renamed from packages/backend/src/misc/generate-native-user-token.ts)5
2 files changed, 3 insertions, 9 deletions
diff --git a/packages/backend/src/misc/is-native-token.ts b/packages/backend/src/misc/is-native-token.ts
deleted file mode 100644
index 300c4c05b3..0000000000
--- a/packages/backend/src/misc/is-native-token.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * SPDX-FileCopyrightText: syuilo and misskey-project
- * SPDX-License-Identifier: AGPL-3.0-only
- */
-
-// eslint-disable-next-line import/no-default-export
-export default (token: string) => token.length === 16;
diff --git a/packages/backend/src/misc/generate-native-user-token.ts b/packages/backend/src/misc/token.ts
index 85fb383ba2..5d37cba26d 100644
--- a/packages/backend/src/misc/generate-native-user-token.ts
+++ b/packages/backend/src/misc/token.ts
@@ -5,5 +5,6 @@
import { secureRndstr } from '@/misc/secure-rndstr.js';
-// eslint-disable-next-line import/no-default-export
-export default () => secureRndstr(16);
+export const generateNativeUserToken = () => secureRndstr(16);
+
+export const isNativeUserToken = (token: string) => token.length === 16;