feat: improve form results and harden secrets

This commit is contained in:
2026-07-30 14:48:46 +07:00 Unverified
parent 6b0440602b
commit a014f72d0f
32 changed files with 471 additions and 11 deletions
+1
View File
@@ -1,3 +1,4 @@
import "server-only";
import type { NextAuthOptions } from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
import { DrizzleAdapter } from "@auth/drizzle-adapter";
+1
View File
@@ -1,3 +1,4 @@
import "server-only";
import { getServerSession } from "next-auth";
import type { Session } from "next-auth";
import { db } from "@/db";
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
export interface DiscordRole {
id: string;
name: string;
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
export async function getDiscordMemberCount(): Promise<number | null> {
const token = process.env.DISCORD_BOT_TOKEN;
const guildId = process.env.DISCORD_GUILD_ID;
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
import { getYoutubeSubscriberCount } from "./youtube";
import { getRobloxFollowerCount } from "./roblox";
import { getDiscordMemberCount } from "./discord";
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
export async function getRobloxFollowerCount(): Promise<number | null> {
const userId = process.env.ROBLOX_USER_ID;
if (!userId) return null;
+3 -1
View File
@@ -1,3 +1,5 @@
import "server-only";
let cachedAccessToken: string | null = null;
let tokenExpiresAt = 0;
@@ -134,4 +136,4 @@ export async function getLatestTiktokVideo(): Promise<TiktokVideo | null> {
console.error("[TikTok API] Error fetching latest video via TikWM:", e);
return null;
}
}
}
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
export async function getYoutubeSubscriberCount(): Promise<number | null> {
const apiKey = process.env.YOUTUBE_API_KEY;
const channelId = process.env.YOUTUBE_CHANNEL_ID;
+2
View File
@@ -1,3 +1,5 @@
import "server-only";
export type DiscordVoiceChannel = {
id: string;
name: string;