Skip to content

Commit

Permalink
fix: if project secret key use, force usage
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Feb 24, 2024
1 parent a183b3d commit f4fbca0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/server/middleware/1.hub-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export default eventHandler(async (event) => {

// Self-hosted NuxtHub project, user has to set a secret key to access the proxy
const projectSecretKey = process.env.NUXT_HUB_PROJECT_SECRET_KEY
if (projectSecretKey && secretKeyOrUserToken !== projectSecretKey) {
if (projectSecretKey && secretKeyOrUserToken === projectSecretKey) {
return
} else if (projectSecretKey) {
throw createError({
statusCode: 401,
message: 'Invalid secret key'
Expand Down

0 comments on commit f4fbca0

Please sign in to comment.