From 64c5077506087ea5723eb8f1878e6bd316e80713 Mon Sep 17 00:00:00 2001 From: James Butler <107124766+domestic-fennec@users.noreply.github.com> Date: Thu, 22 Jun 2023 19:13:05 +0100 Subject: [PATCH] fix: self-host unable to use Azure oauth (#3138) --- .env.example | 1 + .../src/auth/strategies/microsoft.strategy.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 8281e999f..ddcf09a35 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,7 @@ MICROSOFT_CLIENT_ID="************************************************" MICROSOFT_CLIENT_SECRET="************************************************" MICROSOFT_CALLBACK_URL="http://localhost:3170/v1/auth/microsoft/callback" MICROSOFT_SCOPE="user.read" +MICROSOFT_TENANT="common" # Mailer config MAILER_SMTP_URL="smtps://user@domain.com:pass@smtp.domain.com" diff --git a/packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts b/packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts index d3007548e..75e561ee4 100644 --- a/packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts +++ b/packages/hoppscotch-backend/src/auth/strategies/microsoft.strategy.ts @@ -17,7 +17,7 @@ export class MicrosoftStrategy extends PassportStrategy(Strategy) { clientSecret: process.env.MICROSOFT_CLIENT_SECRET, callbackURL: process.env.MICROSOFT_CALLBACK_URL, scope: [process.env.MICROSOFT_SCOPE], - passReqToCallback: true, + tenant: process.env.MICROSOFT_TENANT, store: true, }); }