Skip to content

Commit 88531a8

Browse files
committed
fix: project id bearer
1 parent aba3fa0 commit 88531a8

File tree

1 file changed

+1
-11
lines changed
  • packages/backend/src/api/v1/auth

1 file changed

+1
-11
lines changed

packages/backend/src/api/v1/auth/utils.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,14 @@ export async function authMiddleware(ctx: Context, next: Next) {
8787

8888
const bearerToken = ctx.request?.headers?.authorization?.split(" ")[1]
8989

90-
if (isPublicRoute && (!bearerToken || validateUUID(bearerToken))) {
90+
if (isPublicRoute) {
9191
if (validateUUID(bearerToken)) {
9292
ctx.state.projectId = bearerToken as string
9393
}
9494
await next()
9595
return
9696
}
9797

98-
if (isPublicRoute) {
99-
const bearerToken = ctx.request?.headers?.authorization?.split(" ")[1]
100-
101-
if (typeof bearerToken === "string") {
102-
ctx.state.projectId = bearerToken
103-
}
104-
await next()
105-
return
106-
}
107-
10898
try {
10999
if (!bearerToken) {
110100
throw new Error("No bearer token provided.")

0 commit comments

Comments
 (0)