summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-07 19:36:43 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-08-07 19:36:43 +1000
commit12799f3d12cf52cb02ad0aa4ce052c477faf241e (patch)
tree56be7a41d8b958067c6a4ae59d4c0ef57fcb5e8d /src
parentgoof (diff)
downloadserver-12799f3d12cf52cb02ad0aa4ce052c477faf241e.tar.xz
allow bot/bearer tokens through Authorization header
Diffstat (limited to 'src')
-rw-r--r--src/util/util/Token.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/util/util/Token.ts b/src/util/util/Token.ts
index eec72522..97bdec74 100644
--- a/src/util/util/Token.ts
+++ b/src/util/util/Token.ts
@@ -40,6 +40,9 @@ export const checkToken = (
 	},
 ): Promise<UserTokenData> =>
 	new Promise((resolve, reject) => {
+		token = token.replace("Bot ", ""); // there is no bot distinction in sb
+		token = token.replace("Bearer ", ""); // allow bearer tokens
+
 		jwt.verify(
 			token,
 			Config.get().security.jwtSecret,