nicholastay / passport-discord

Passport strategy for authentication with Discord (discordapp.com)
ISC License
172 stars 55 forks source link

Refactor Passport-Discord Strategy and Update Documentation #58

Open 3tatsu opened 8 months ago

3tatsu commented 8 months ago

Description:

This pull request introduces a series of updates and refactors to the Passport-Discord authentication strategy, enhancing the codebase with TypeScript features and improving documentation for better clarity and maintainability.

Key Changes:

  1. TypeScript Refactoring: The strategy.ts file has been refactored to use TypeScript classes, providing stronger type safety and aligning with modern TypeScript practices.
  2. Updated Export Method: Changed the export method in index.ts to a named export, allowing for more explicit and readable imports in server-side code.
  3. README Update: The README.md file has been revised to include updated installation and usage instructions, reflecting the recent changes in the code.
  4. Server.js Adjustments: Modified the server.js file to correctly import and utilize the updated Discord strategy, ensuring compatibility with the refactored code.

Purpose:

These changes aim to modernize the codebase, leveraging TypeScript's capabilities for better type checking and developer experience. Additionally, the updated documentation will assist new and existing users in understanding and implementing the strategy in their applications.

Testing:

Request for Feedback:

I welcome any feedback or suggestions on further improvements, particularly in areas of TypeScript best practices and strategy implementation efficiency.