feat: initial prototype works

I can log in and create a book! Woo!
This commit is contained in:
2026-02-04 12:17:05 -08:00
parent e167a17bd9
commit b6d66d34cb
44 changed files with 3695 additions and 493 deletions
+2 -4
View File
@@ -9,9 +9,6 @@ declare module "fastify" {
authenticate: (request: FastifyRequest) => Promise<void>;
oauth2Discord: any;
}
interface FastifyRequest {
user?: any;
}
}
const authPlugin: FastifyPluginAsync = async (app) => {
@@ -30,6 +27,7 @@ const authPlugin: FastifyPluginAsync = async (app) => {
// Register Discord OAuth2
app.register(fastifyOauth2, {
name: "oauth2Discord",
scope: ["identify", "email"],
credentials: {
client: {
id: process.env.DISCORD_CLIENT_ID || "",
@@ -38,7 +36,7 @@ const authPlugin: FastifyPluginAsync = async (app) => {
auth: fastifyOauth2.DISCORD_CONFIGURATION,
},
startRedirectPath: "/api/auth/login",
callbackUri: `${process.env.API_URL || "http://localhost:3000"}/api/auth/callback`,
callbackUri: `${process.env.BASE_URL || "http://localhost:3000"}/api/auth/callback`,
});
// Authentication decorator