Adding Microsoft auth
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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'];
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user