generated from nhcarrigan/template
feat: initial prototype works
I can log in and create a book! Woo!
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user