Enhance Discord integration by adding optional bot permissions in environment files and updating the dashboard to include an "Add Bot to your Server" button. Refactor authentication logic to handle token refresh and improve error handling for Discord sessions. Update placeholder text for better clarity in the search input field.
This commit is contained in:
33
dashboard/app/api/invite/route.ts
Normal file
33
dashboard/app/api/invite/route.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* ╔══════════════════════════════════════════════════════════════════╗
|
||||
* ║ ║
|
||||
* ║ +-+-+-+-+-+-+-+-+ ║
|
||||
* ║ |H|e|x|a|H|o|s|t| ║
|
||||
* ║ +-+-+-+-+-+-+-+-+ ║
|
||||
* ║ ║
|
||||
* ║ © 2026 HexaHost — All Rights Reserved ║
|
||||
* ║ ║
|
||||
* ║ discord ── https://discord.gg/hexahost ║
|
||||
* ║ github ── https://github.com/theoneandonlymace ║
|
||||
* ║ ║
|
||||
* ╚══════════════════════════════════════════════════════════════════╝
|
||||
*/
|
||||
import { NextResponse } from "next/server";
|
||||
import { getBotInviteUrl } from "@/lib/discord-invite";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
/** Redirects to the Discord bot invite (uses DISCORD_CLIENT_ID at runtime). */
|
||||
export async function GET() {
|
||||
const url = getBotInviteUrl();
|
||||
if (!url) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
detail:
|
||||
"DISCORD_CLIENT_ID is not configured. Set it in the dashboard environment.",
|
||||
},
|
||||
{ status: 503 }
|
||||
);
|
||||
}
|
||||
return NextResponse.redirect(url, 302);
|
||||
}
|
||||
Reference in New Issue
Block a user