fix secrets mess

This commit is contained in:
not-nullptr 2024-03-11 00:17:41 +00:00
parent 57e423633c
commit 2442d891b8
6 changed files with 9 additions and 5 deletions

2
.gitignore vendored
View file

@ -10,4 +10,4 @@ vite.config.js.timestamp-*
vite.config.ts.timestamp-*
ssl
*.sqlite
src/lib/server/secrets
src/lib/server/secrets/secrets.json

View file

@ -0,0 +1,4 @@
{
"PUBLIC_KEY": "-----BEGIN PUBLIC...",
"PRIVATE_KEY": "-----BEGIN PRIVATE..."
}

View file

@ -1,6 +1,6 @@
import type { IJwtData } from "$types/auth";
import type { Role } from "$types/db";
import { PUBLIC_KEY } from "../secrets";
import { PUBLIC_KEY } from "../secrets/secrets.json";
import jwt from "jsonwebtoken";
export function json<T>(body: T): Response {

View file

@ -1,6 +1,6 @@
import { userRepo } from "$lib/server/repo";
import type { SuyuUser } from "$lib/server/schema";
import { PUBLIC_KEY } from "$lib/server/secrets";
import { PUBLIC_KEY } from "$lib/server/secrets/secrets.json";
import type { IJwtData } from "$types/auth";
import cookie from "cookie";
import jwt from "jsonwebtoken";

View file

@ -1,4 +1,4 @@
import { PRIVATE_KEY } from "$lib/server/secrets/index.js";
import { PRIVATE_KEY } from "$lib/server/secrets/secrets.json";
import { useAuth } from "$lib/util/api/index.js";
import jwt from "jsonwebtoken";

View file

@ -1,7 +1,7 @@
import { Room, RoomManager } from "$lib/server/class/Room";
import { userRepo } from "$lib/server/repo/index.js";
import { SuyuUser } from "$lib/server/schema";
import { PUBLIC_KEY } from "$lib/server/secrets/index.js";
import { PUBLIC_KEY } from "$lib/server/secrets/secrets.json";
import { json } from "$lib/server/util";
import type { IJwtData } from "$types/auth.js";
import type { IRoom, LobbyResponse } from "$types/rooms";