From c63d1ea58b1623ddb548a73360c079e97337b962 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 23 Jul 2021 20:32:00 -0600 Subject: [PATCH] Pass the credentials to the endpoint --- src/main.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 4e27ef5..5dbb229 100644 --- a/src/main.ts +++ b/src/main.ts @@ -45,13 +45,13 @@ async function init() { // Setup authentication server.register(basic); server.auth.strategy(`simple`, `basic`, { - async validate(request: Request, user: string, pass: string, h: ResponseToolkit) { + async validate(request: Request, user: string, password: string, h: ResponseToolkit) { // Are we attempting to authenticate, then use the auth password if (request.path.startsWith(`/discord/auth`)) { return { - isValid: config.discord.auth_password === pass, - credentials: { pass }, + isValid: config.discord.auth_password === password, + credentials: { user, password }, }; }; @@ -61,8 +61,8 @@ async function init() { }; return { - isValid: config.guilds[user].password === pass, - credentials: { user } + isValid: config.guilds[user].password === password, + credentials: { user, password } }; }, allowEmptyUsername: true,