You've already forked AstralRinth
forked from didirus/AstralRinth
Fix random Nuxt internal server errors (#551)
* Fix random Nuxt internal server errors * Fix ratelimit key being exposed * Add GDPR clarification
This commit is contained in:
@@ -17,12 +17,15 @@ export const mutations = {
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
async fetchUser({ commit }, { token }) {
|
||||
async fetchUser({ commit, state }, { token }) {
|
||||
try {
|
||||
const user = (
|
||||
await this.$axios.get(`user`, {
|
||||
headers: {
|
||||
Authorization: token,
|
||||
'x-ratelimit-key': process.server
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY
|
||||
: '',
|
||||
},
|
||||
})
|
||||
).data
|
||||
|
||||
18
store/tag.js
18
store/tag.js
@@ -26,13 +26,21 @@ export const mutations = {
|
||||
|
||||
export const actions = {
|
||||
async fetchAllTags({ commit }) {
|
||||
const headers = {
|
||||
headers: {
|
||||
'x-ratelimit-key': process.server
|
||||
? process.env.RATE_LIMIT_IGNORE_KEY
|
||||
: '',
|
||||
},
|
||||
}
|
||||
|
||||
const [categories, loaders, gameVersions, licenses, donationPlatforms] = (
|
||||
await Promise.all([
|
||||
this.$axios.get(`tag/category`),
|
||||
this.$axios.get(`tag/loader`),
|
||||
this.$axios.get(`tag/game_version`),
|
||||
this.$axios.get(`tag/license`),
|
||||
this.$axios.get(`tag/donation_platform`),
|
||||
this.$axios.get(`tag/category`, headers),
|
||||
this.$axios.get(`tag/loader`, headers),
|
||||
this.$axios.get(`tag/game_version`, headers),
|
||||
this.$axios.get(`tag/license`, headers),
|
||||
this.$axios.get(`tag/donation_platform`, headers),
|
||||
])
|
||||
).map((it) => it.data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user