Fix nuxt3 issues (#1035)

* Fix nuxt3 issues

* fix unintentional npm use
This commit is contained in:
Geometrically
2023-03-10 14:51:48 -07:00
committed by GitHub
parent 3825575f70
commit ba220abbbf
6 changed files with 822 additions and 826 deletions

View File

@@ -5,8 +5,11 @@ export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.provide('defaultHeaders', () => {
const obj = { headers: {} }
if (process.server && process.env.RATE_LIMIT_IGNORE_KEY) {
obj.headers['x-ratelimit-key'] = process.env.RATE_LIMIT_IGNORE_KEY || ''
if (process.server) {
const config = useRuntimeConfig()
if (config.rateLimitKey) {
obj.headers['x-ratelimit-key'] = config.rateLimitKey || ''
}
}
if (authStore.user) {