new things.

This commit is contained in:
2025-09-12 20:45:48 -04:00
parent c2eb111291
commit 5934f1a91c
11 changed files with 43 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import { sign } from "@hono/hono/jwt";
import { CachedLogin, DbCachedLogin, PlatformMask, PlatformType, TokenFormat, TokenType } from "./types.ts";
import type Profile from "../profiles/profile.ts";
import { getNetConfig } from "../../net.ts";
import { env } from "../../env.ts";
export const steamAuthTicketSchema = z.object({
Ticket: z.string().min(256),
@@ -23,7 +24,7 @@ export class PlatformsManager extends ServerContentBase {
}
async getToken(prof: Profile, type: TokenType) {
const secret = Deno.env.get('SECRET');
const secret = env["SECRET"];
if (!secret) throw new Error("No SECRET in env. Did you forget to set it?");
const exp = type == TokenType.Access ? Math.round(Date.now() / 1000) + 21_600 : Math.round(Date.now() / 1000) + 31_556_952;