Adding Microsoft auth

This commit is contained in:
Corey Blais
2026-04-15 17:51:17 -04:00
parent 5218a24bd1
commit 31464d9940
5 changed files with 9 additions and 1 deletions
+1
View File
@@ -5,5 +5,6 @@ FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:5000
VITE_API_BASE_URL=http://localhost:5000/api
NODE_ENV=development
TRUST_PROXY=
ADMIN_EMAILS=corey@blaishome.online
RESCUE_STATUS_NOTIFICATION_EMAIL=appadmin@flockpal.app
+5
View File
@@ -89,6 +89,11 @@ const port = Number(process.env.PORT ?? 5000);
const frontendBaseUrl = process.env.FRONTEND_URL ?? 'http://localhost:3000';
const backendBaseUrl = process.env.BACKEND_URL ?? `http://localhost:${port}`;
const sessionDays = 30;
const trustProxy = process.env.TRUST_PROXY?.trim() ?? '';
if (trustProxy) {
app.set('trust proxy', trustProxy === 'true' ? true : Number(trustProxy) || trustProxy);
}
const defaultAllowedOrigins = ['http://localhost:3000', 'http://127.0.0.1:3000', 'http://localhost:5173', 'http://127.0.0.1:5173'];
+1
View File
@@ -23,6 +23,7 @@ services:
environment:
PORT: 5000
NODE_ENV: production
TRUST_PROXY: ${TRUST_PROXY:-1}
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB:-flockpal}
+1
View File
@@ -22,6 +22,7 @@ services:
environment:
PORT: 5000
NODE_ENV: development
TRUST_PROXY: ${TRUST_PROXY:-}
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB:-flockpal}
+1 -1
View File
@@ -471,7 +471,7 @@ const clearSessionToken = () => {
const readStoredSessionToken = () => window.localStorage.getItem(sessionTokenStorageKey) ?? '';
const oauthStartUrl = (providerKey: AuthProvider['providerKey']) => {
const url = new URL(`${apiBaseUrl}/auth/oauth/${providerKey}/start`);
const url = new URL(`${apiBaseUrl}/auth/oauth/${providerKey}/start`, window.location.origin);
url.searchParams.set('redirectTo', window.location.href);
return url.toString();
};