File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/runtime/server/middleware Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,20 @@ export default eventHandler(async (event) => {
1717 message : 'Missing Authorization header'
1818 } )
1919 }
20+ const projectKey = process . env . NUXT_HUB_PROJECT_KEY
2021
2122 // Self-hosted NuxtHub project, user has to set a secret key to access the proxy
2223 const projectSecretKey = process . env . NUXT_HUB_PROJECT_SECRET_KEY
2324 if ( projectSecretKey && secretKeyOrUserToken === projectSecretKey ) {
2425 return
25- } else if ( projectSecretKey ) {
26+ } else if ( projectSecretKey && ! projectKey ) {
2627 throw createError ( {
2728 statusCode : 401 ,
2829 message : 'Invalid secret key'
2930 } )
3031 }
3132
3233 // Hosted on NuxtHub
33- const projectKey = process . env . NUXT_HUB_PROJECT_KEY
3434 if ( projectKey ) {
3535 // Here the secretKey is a user token
3636 await $fetch ( `/api/projects/${ projectKey } ` , {
You can’t perform that action at this time.
0 commit comments