Add authed

This commit is contained in:
MartinBraquet
2025-10-15 23:20:20 +02:00
parent 80d7061e5f
commit 89bd164d43
3 changed files with 3 additions and 3 deletions

View File

@@ -183,7 +183,7 @@ export type APIHandler<N extends APIPath> = (
const __rateLimitState: Map<string, { windowStart: number; count: number }> = new Map()
function getRateLimitConfig() {
const authed = Number(process.env.API_RATE_LIMIT_PER_MIN_AUTHED ?? 30)
const authed = Number(process.env.API_RATE_LIMIT_PER_MIN_AUTHED ?? 120)
const unAuthed = Number(process.env.API_RATE_LIMIT_PER_MIN_UNAUTHED ?? 30)
return {authedLimit: authed, unAuthLimit: unAuthed}
}

View File

@@ -225,7 +225,7 @@ export const API = (_apiTypeCheck = {
},
'compatible-profiles': {
method: 'GET',
authed: true,
authed: false,
rateLimited: true,
props: z.object({userId: z.string()}),
returns: {} as {

View File

@@ -67,7 +67,7 @@ export async function baseApiCall(props: {
body:
params == null || method === 'GET' ? undefined : JSON.stringify(params),
})
// console.debug(req)
console.log('Request', req)
return fetch(req).then(async (resp) => {
const json = (await resp.json()) as { [k: string]: any }
if (!resp.ok) {