Commit graph

17 commits

Author SHA1 Message Date
Vadym Samoilenko
4d04d4b251 Add basename to BrowserRouter to fix 404 after login on server
BrowserRouter without a basename sees /lusa-Back-Planner/ as the pathname,
which doesn't match route path="/", so React Router falls to NotFound.
Using import.meta.env.BASE_URL (set by Vite's base config) fixes both
prod and dev environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 12:04:28 +00:00
Vadym Samoilenko
78582ed381 Fix documented server redirect URI to match Azure AD registration
Update CLAUDE.md to use correct mixed-case URL without trailing slash
(lusa-Back-Planner) to match what is registered in Azure AD.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 12:01:35 +00:00
Vadym Samoilenko
51bfd5b77c Explicitly set redirectUri in loginRequest for popup
loginPopup defaults to window.location.href when no redirectUri is set
in the request — causing a mismatch if the user visits a lowercase URL.
Pinning redirectUri from config ensures Microsoft always receives the
exact registered URI regardless of how the user navigated to the app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:58:13 +00:00
Vadym Samoilenko
19dc7942c2 Restore executable bit on deploy.sh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:55:15 +00:00
Vadym Samoilenko
742b5a042d Clear Vite cache before build in deploy script
Vite caches built assets and reuses them across builds, causing env
variable changes to not take effect. Always wipe dist/ and
node_modules/.vite before building.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:54:26 +00:00
Vadym Samoilenko
66439a601c Make deploy.sh executable in git
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:53:19 +00:00
Vadym Samoilenko
46cddc7408 Show redirect URI in deploy output for easier debugging
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:51:55 +00:00
Vadym Samoilenko
2e3a72c42a Switch MSAL login from redirect to popup
loginRedirect causes interaction_in_progress because MSAL's internal
NavigationClient can't navigate to /lusa-Back-Planner/ (base path)
via React Router after returning from Microsoft auth — leaving the
interaction lock set. loginPopup avoids the redirect cycle entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:49:21 +00:00
Vadym Samoilenko
ed638ff8cd Fix MSAL interaction_in_progress and redirect URI mismatch
- Refactor auth init: initialize MSAL before React mounts so MsalProvider
  handles handleRedirectPromise exactly once (no double-calls, no stale locks)
- Simplify AuthGuard to pure AuthenticatedTemplate/UnauthenticatedTemplate
- Remove trailing slash from redirect URI to match Azure AD registration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:46:41 +00:00
Vadym Samoilenko
03fd4be165 Fix MSAL interaction_in_progress on page reload
Clear stale interaction.status key from localStorage before MSAL
initializes. A failed or interrupted loginRedirect leaves this lock
set, blocking all subsequent auth calls with interaction_in_progress.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:43:00 +00:00
Vadym Samoilenko
f1061f56b1 Fix MSAL crash on localStorage key iteration
Purge stale msal.* keys from sessionStorage before MSAL initializes.
When cache location was switched from sessionStorage to localStorage,
leftover MSAL entries caused Storage.key(i) to return null during
createKeyMaps iteration, crashing isCredentialKey with TypeError.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:41:25 +00:00
Vadym Samoilenko
9958c903c5 Fix MSAL SSO redirect and add deploy script
- Switch MSAL cache to localStorage + cookie fallback to fix AADSTS90014 (PKCE state lost on redirect)
- Fix base path and redirect URI to use correct case: lusa-Back-Planner
- Add deploy.sh for server-side build and deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 11:38:56 +00:00
Manish Tanwar
7c19fb5c37 add msal sso-page-error 2026-03-16 16:28:47 +05:30
Manish Tanwar
57c4ea9363 add msal sso-page and env-1 2026-03-16 12:52:32 +05:30
Manish Tanwar
d375ac7b31 add msal sso-page and env 2026-03-13 08:32:11 +05:30
Vadym Samoilenko
d2424d288a Add Azure AD SSO (MSAL) and deployment config
- MSAL SPA redirect flow with Azure AD authentication
- AuthGuard wrapper with auto-redirect for unauthenticated users
- Navbar shows logged-in user name and sign out button
- Vite base path set to /lusa-back-planner/ for subdirectory hosting
- Apache config for SPA fallback routing
- Environment variables for Azure AD tenant/client/redirect

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 18:41:56 +00:00
DJP
207a922ca7 Initial commit: LUSA Back Planner 2026-03-06 13:25:24 -05:00