feat: improve form results and harden secrets
This commit is contained in:
@@ -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,3 +1,4 @@
|
||||
import "server-only";
|
||||
import { getServerSession } from "next-auth";
|
||||
import type { Session } from "next-auth";
|
||||
import { db } from "@/db";
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import "server-only";
|
||||
|
||||
export interface DiscordRole {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import "server-only";
|
||||
|
||||
import { getYoutubeSubscriberCount } from "./youtube";
|
||||
import { getRobloxFollowerCount } from "./roblox";
|
||||
import { getDiscordMemberCount } from "./discord";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import "server-only";
|
||||
|
||||
export type DiscordVoiceChannel = {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user