summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/common/generate-native-user-token.ts2
-rw-r--r--src/server/api/common/is-native-token.ts2
-rw-r--r--src/server/api/endpoints/auth/accept.ts2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/server/api/common/generate-native-user-token.ts b/src/server/api/common/generate-native-user-token.ts
index 9d44885630..a372221a0a 100644
--- a/src/server/api/common/generate-native-user-token.ts
+++ b/src/server/api/common/generate-native-user-token.ts
@@ -1,3 +1,3 @@
import rndstr from 'rndstr';
-export default () => `0${rndstr('a-zA-Z0-9', 15)}`;
+export default () => rndstr('a-zA-Z0-9', 16);
diff --git a/src/server/api/common/is-native-token.ts b/src/server/api/common/is-native-token.ts
index 22af84aad2..2833c570c8 100644
--- a/src/server/api/common/is-native-token.ts
+++ b/src/server/api/common/is-native-token.ts
@@ -1 +1 @@
-export default (token: string) => token.startsWith('0');
+export default (token: string) => token.length === 16;
diff --git a/src/server/api/endpoints/auth/accept.ts b/src/server/api/endpoints/auth/accept.ts
index a584e7267b..be7f3b5468 100644
--- a/src/server/api/endpoints/auth/accept.ts
+++ b/src/server/api/endpoints/auth/accept.ts
@@ -39,7 +39,7 @@ export default define(meta, async (ps, user) => {
}
// Generate access token
- const accessToken = '1' + rndstr('a-zA-Z0-9', 15);
+ const accessToken = rndstr('a-zA-Z0-9', 32);
// Fetch exist access token
const exist = await AccessTokens.findOne({