mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-03 20:55:45 -04:00
Add authed
This commit is contained in:
@@ -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}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user