fix: eslint
This commit is contained in:
parent
c37f8f77c2
commit
46567538dc
6 changed files with 6 additions and 9 deletions
|
|
@ -15,6 +15,6 @@ export default [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ignores: ["eslint.config.js", "prettier.config.js"],
|
ignores: ["eslint.config.js", "prettier.config.js", ".output/**"],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,7 @@ function GlobalNav({ pathname }: { pathname: string }) {
|
||||||
const isActive =
|
const isActive =
|
||||||
to === "/apps"
|
to === "/apps"
|
||||||
? pathname === "/apps" || pathname === "/apps/"
|
? pathname === "/apps" || pathname === "/apps/"
|
||||||
: to === "/sessions"
|
: pathname === to;
|
||||||
? pathname.startsWith("/sessions")
|
|
||||||
: pathname === to;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export async function authenticateApiKey(
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const candidate of candidates) {
|
for (const candidate of candidates) {
|
||||||
if (candidate.app?.deletedAt) continue;
|
if (candidate.app.deletedAt) continue;
|
||||||
const valid = await verifyApiKey(key, candidate.keyHash);
|
const valid = await verifyApiKey(key, candidate.keyHash);
|
||||||
if (valid) return { appId: candidate.appId, keyId: candidate.id };
|
if (valid) return { appId: candidate.appId, keyId: candidate.id };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ export async function usePostgresAuthState(
|
||||||
|
|
||||||
async set(data: SignalDataSet) {
|
async set(data: SignalDataSet) {
|
||||||
for (const [type, typeData] of Object.entries(data)) {
|
for (const [type, typeData] of Object.entries(data)) {
|
||||||
if (!typeData) continue;
|
|
||||||
for (const [id, value] of Object.entries(typeData)) {
|
for (const [id, value] of Object.entries(typeData)) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
await db
|
await db
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export const Route = createFileRoute("/api/v1/admin/apps/")({
|
||||||
const session = await readSession(request);
|
const session = await readSession(request);
|
||||||
if (!session?.userId) return jsonError("Unauthorized", 401);
|
if (!session?.userId) return jsonError("Unauthorized", 401);
|
||||||
|
|
||||||
let body: { name: string; maxSessions?: number };
|
let body: { name?: string; maxSessions?: number };
|
||||||
try {
|
try {
|
||||||
body = await request.json();
|
body = await request.json();
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
|
|
@ -56,12 +56,12 @@ async function api(
|
||||||
opts: { apiKey?: string; body?: unknown } = {},
|
opts: { apiKey?: string; body?: unknown } = {},
|
||||||
): Promise<ApiResult> {
|
): Promise<ApiResult> {
|
||||||
return page.evaluate(
|
return page.evaluate(
|
||||||
async ({ method, url, apiKey, body }) => {
|
async ({ method: httpMethod, url, apiKey, body }) => {
|
||||||
const headers: Record<string, string> = {};
|
const headers: Record<string, string> = {};
|
||||||
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
||||||
if (body !== undefined) headers["Content-Type"] = "application/json";
|
if (body !== undefined) headers["Content-Type"] = "application/json";
|
||||||
const res = await fetch(url, {
|
const res = await fetch(url, {
|
||||||
method,
|
method: httpMethod,
|
||||||
headers,
|
headers,
|
||||||
body: body !== undefined ? JSON.stringify(body) : undefined,
|
body: body !== undefined ? JSON.stringify(body) : undefined,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue