Commit Graph

15 Commits

Author SHA1 Message Date
Matt 61235b163d feat: Implement unified sidebar with Nuxt UI across all dashboard pages
- Install @nuxt/ui and integrate with existing Vuetify
- Create new layouts/dashboard-unified.vue with modern sidebar design
- Features: clean white design, collapsible sidebar, role-based navigation
- Remove old layouts/dashboard.vue to eliminate dual-sidebar confusion
- Update all dashboard pages to use dashboard-unified layout
- Add demo page showcasing new sidebar features
- Fix auth error handler to ignore external service 401 errors
- Ensure consistent navigation experience across entire platform
2025-07-11 16:33:11 -04:00
Matt 9d49245efa refactor: replace Puppeteer with PDFKit for PDF generation
- Updated package.json to remove Puppeteer and add PDFKit and its types.
- Refactored generate-pdf.ts to utilize PDFKit for generating PDFs instead of Puppeteer.
- Implemented functions to add headers, summaries, expense tables, and receipt images using PDFKit.
- Removed HTML content generation and related functions, streamlining the PDF generation process.
- Added error handling for receipt image fetching and improved logging.
2025-07-09 22:38:46 -04:00
Matt 893927d4b1 Refactor expense form and add PDF generation functionality
- Update expense form fields (merchant->establishmentName, amount->price)
- Add PDF generation with Puppeteer integration
- Create PDFOptionsModal component for export options
- Update expense form validation and UI layout
- Add server API endpoint for PDF generation
2025-07-09 22:23:50 -04:00
Matt e66d6ad1f2 Add processing fee option to PDF export modal
- Add checkbox to include 5% processing fee in PDF exports
- Install PDF generation dependencies (@pdfme/common, @pdfme/generator, sharp)
- Add server-side expenses API endpoints
- Update PDF options interface to support processing fee toggle
2025-07-04 09:27:43 -04:00
Matt 30223746e1 FINAL FIX: Complete Custom Keycloak Authentication
##  **ALL ISSUES RESOLVED:**

### ** Fixed TypeScript Import Issues:**
-  Removed .nuxt cache and regenerated types
-  Cleaned package.json - removed
uxt-oidc-auth completely
-  Updated useUnifiedAuth.ts to use useCustomAuth instead of useOidcAuth
-  Fixed authentication middleware to use session API call

### ** Complete Authentication System:**
-  Custom OAuth 2.0 flow with Keycloak
-  HTTP-only cookie session management
-  Dual auth support (Keycloak + Directus fallback)
-  Proper logout flow with Keycloak SSO cleanup

### ** Dashboard Access:**
-  Fixed layout authentication state
-  User info properly displayed in sidebar
-  Full navigation menu access
-  All dashboard routes accessible after login

### ** Logout Flow:**
-  Clears local session cookie
-  Redirects to Keycloak logout
-  Keycloak redirects back to /login page

##  **READY FOR PRODUCTION:**
The custom Keycloak SSO system should now work completely without 502/500 errors:

1. **Login**  Keycloak SSO  Token exchange  Session creation  Dashboard
2. **Navigation**  Full dashboard access with sidebar
3. **Logout**  Session cleanup  Keycloak logout  Return to login

Deploy and test - should work perfectly!
2025-06-15 16:07:51 +02:00
Matt 0ae190b255 MAJOR: Replace keycloak-js with nuxt-oidc-auth for seamless SSO integration
##  **SOLUTION: Migrate to Server-Side OIDC Authentication**

This completely replaces the problematic keycloak-js client-side implementation
with nuxt-oidc-auth, eliminating all CORS and iframe issues.

###  **Benefits:**
- **No more CORS errors** - Server-side OAuth flow
- **No iframe dependencies** - Eliminates cross-domain issues
- **Works with nginx proxy** - No proxy configuration conflicts
- **Better security** - Tokens handled server-side
- **Cleaner integration** - Native Nuxt patterns
- **Maintains Directus compatibility** - Dual auth support

###  **Installation & Configuration:**
- Added
uxt-oidc-auth module to nuxt.config.ts
- Configured Keycloak provider with proper OIDC settings
- Updated environment variables for security keys

###  **Code Changes:**

#### **Authentication Flow:**
- **middleware/authentication.ts** - Updated to check both Directus + OIDC auth
- **composables/useUnifiedAuth.ts** - Migrated to use useOidcAuth()
- **pages/login.vue** - Updated SSO button to use oidcLogin('keycloak')

#### **Configuration:**
- **nuxt.config.ts** - Added OIDC provider configuration
- **.env.example** - Updated with nuxt-oidc-auth environment variables
- Removed old Keycloak runtime config

#### **Cleanup:**
- Removed keycloak-js dependency from package.json
- Deleted obsolete files:
  - composables/useKeycloak.ts
  - pages/auth/callback.vue
  - server/utils/keycloak-oauth.ts
  - server/api/debug/ directory

###  **Authentication Routes (Auto-Generated):**
- /auth/keycloak/login - SSO login endpoint
- /auth/keycloak/logout - SSO logout endpoint
- /auth/keycloak/callback - OAuth callback (handled automatically)

###  **Security Setup Required:**
Environment variables needed for production:
- NUXT_OIDC_PROVIDERS_KEYCLOAK_CLIENT_SECRET
- NUXT_OIDC_TOKEN_KEY (base64 encoded 32-byte key)
- NUXT_OIDC_SESSION_SECRET (48-character random string)
- NUXT_OIDC_AUTH_SESSION_SECRET (48-character random string)

###  **Expected Results:**
 SSO login should work without CORS errors
 Compatible with nginx proxy setup
 Maintains existing Directus authentication
 Server-side session management
 Automatic token refresh

Ready for container rebuild and production testing!
2025-06-14 15:58:03 +02:00
Matt a797c13867 MAJOR: Replace nuxt-openid-connect with official Keycloak JS adapter
- Remove problematic nuxt-openid-connect module that was causing OAuth issues
- Install and implement official keycloak-js adapter for better reliability
- Create new useKeycloak composable with proper token management
- Update useUnifiedAuth to work with new Keycloak implementation
- Fix authentication middleware to support both auth methods
- Update login page to use new Keycloak login function
- Clean up configuration and remove deprecated OIDC settings
- This should resolve all the HTTP/HTTPS redirect and token exchange issues
2025-06-14 14:50:29 +02:00
Matt 5f8720bb63 Implement Keycloak authentication integration and unify user management 2025-06-14 14:09:56 +02:00
Matt e57756e433 Add phone number formatting and improve UI components
- Integrate libphonenumber-js for proper phone number formatting
- Display phone numbers in national format in PhoneInput component
- Strip non-numeric characters from phone input automatically
- Fix refresh button icon rendering in EmailThreadView
- Improve EOI button layout alignment and centering
2025-06-12 22:35:17 +02:00
Matt 218705da52 Add EOI automation system with email processing and document management
- Implement automated EOI processing from sales emails
- Add EOI document upload and management capabilities
- Enhance email thread handling with better parsing and grouping
- Add retry logic and error handling for file operations
- Introduce Documeso integration for document processing
- Create server tasks and plugins infrastructure
- Update email composer with improved attachment handling
2025-06-10 13:59:09 +02:00
Matt d9fb94a76c Refactor EOI management into dedicated component
Extract EOI links and generation functionality from InterestDetailsModal
into a new reusable EOISection component. This improves code organization
and maintainability while adding debounce support for form submissions.

- Create new EOISection.vue component for EOI management
- Remove inline EOI links section from InterestDetailsModal
- Add debounce utility for form submission handling
- Update email generation and thread fetching logic
- Update related types and utilities
2025-06-10 00:37:43 +02:00
Matt 618c888b85 Add email communication system with encrypted credentials
- Add email components for composing, viewing threads, and credential setup
- Implement server API endpoints for sending emails and fetching threads
- Add encryption utilities for secure credential storage
- Configure email settings in environment variables
- Integrate email functionality into interest details modal
2025-06-09 21:45:06 +02:00
Matt 61cefa530e Add MinIO file browser with upload, preview, and management features
- Implement file browser UI with upload/download capabilities
- Add API endpoints for file operations (list, upload, delete, preview)
- Create FileUploader and FilePreviewModal components
- Configure MinIO integration with environment variables
- Add documentation for MinIO file browser setup
2025-06-04 16:32:50 +02:00
Matt 6b922580c5 Add v-phone-input component for enhanced phone number fields
Replace basic text fields with v-phone-input in CreateInterestModal and
InterestDetailsModal to provide country selection, validation, and better
UX for phone number entry. Includes US as default with preferred countries
list and search functionality.
2025-06-04 02:43:21 +02:00
Ron fbba5a6814 feat: add files 2025-02-16 14:10:19 +02:00