Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Authentication and API Handling Features with New Implementations #3

Merged
merged 41 commits into from
Sep 25, 2024

Conversation

ad956
Copy link
Owner

@ad956 ad956 commented Sep 25, 2024

Title:

✨ Enhance Authentication and API Handling Features with New Implementations

Description:

This pull request introduces several improvements and new features related to authentication and API handling across the application. Key changes include:

  • 🔐 Authentication Enhancements:

    • Implemented and improved user login and signup actions, now utilizing the new fetchHandler for secure API calls and enhanced type safety.
    • Added OTP verification functionality using fetchHandler, which improves security and user feedback during the verification process.
  • 🛠️ Custom Fetch Handler:

    • Created a centralized fetchHandler with TypeScript types for better maintainability and error handling in API requests.
    • Streamlined error handling to provide clearer feedback to users when API calls fail.
  • 👥 Role-Based API Methods:

    • Refactored API calling methods for different user roles (Admin, Patient, etc.) to utilize the new fetchHandler, ensuring consistent and secure data fetching across modules.

These changes significantly enhance the overall security, user experience, and maintainability of the application, laying a strong foundation for future features. 🚀

- Include 'fix-**' branches in GitHub Actions trigger events
- Extend preview deployment to 'fix-' branches
- Maintain existing workflow for 'feature/' branches and production deployment
- NextResponse for consistent API responses
- Removed x-user-id and x-user-role headers
- implementing authenticateUser method for authorization. 🔒✨
- Moved and reorganized types and interfaces for better structure
- Updated API calling methods to improve consistency across roles
- Applied changes for auth, admin, doctor, patient, receptionist, and hospital modules
- Added etchHandler to handle API requests with customizable options
- Support for headers, caching, and revalidation logic
- Integrated session-based authorization using Bearer tokens
- Improved error handling with detailed error structure (title, message, stackTrace)
… type safety 🛡️

- Added API method for fetching admin data using fetchHandler
- Improved type safety with Admin type definition
- Integrated session token for authorization and cache control
… session handling 🩺

- Added API function to retrieve doctor data using fetchHandler
- Ensured type safety for doctor data structure
- Included session token for authentication and used no-cache policy
…andling 🔍

- Added API method to fetch patient data using fetchHandler
- Applied stricter type safety for patient data structure
- Included session token in API calls for secure access
…ken passing 📋

- Implemented API method for fetching receptionist data using fetchHandler
- Improved type safety for receptionist data handling
- Used session token for secure API calls and enhanced error handling
…and session handling 🏥

- Added API method for fetching hospital data using fetchHandler
- Ensured type safety for hospital data structures
- Passed session token for secure API requests and used cache control options
- Added error handling for expired and invalid JWT tokens
- Used AppError to throw appropriate HTTP status codes for authentication errors
- Improved logging for unauthorized access and token decryption failures
…st notifications 🚀

- Added demo user login functionality using fetchHandler for API calls
- Integrated toast notifications for login status (loading, success, error)
- Improved error handling and user feedback for demo login process
@ad956 ad956 merged commit a5e5da2 into main Sep 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant