imperfectandcompany / Imperfect-Gamers-Site-Store

Our robust community site integrating Steam for enhanced user interactions and data management, powered by Remix with Tailwind CSS for optimistic, responsive UI. Features CI/CD with GitHub Actions and Docker for seamless deployment and maintenance.
https://store.imperfectgamers.org/
Other
0 stars 0 forks source link

Implement Persistent Steam ID Session Storage and Database Integration #78

Closed cheesea3 closed 1 month ago

cheesea3 commented 1 month ago

This pull request addresses the issue where the Steam ID is not being persistently stored in the database, requiring users to relink their Steam accounts upon every logout.

Changes Made

Backend Updates

  1. Steam Callback Route
    • Enhanced the loader function in app/routes/auth/steam/callback.tsx to:
      • Verify the Steam assertion.
      • Retrieve and store the steamId in the session.
      • Link the Steam ID to the user's account in the database.
      • Send appropriate success or error messages to the parent window.
    • Added a helper function sendErrorToParent to handle error messaging back to the parent window.

Frontend Updates

  1. AuthorizeForm Component
    • Updated app/components/molecules/AuthorizeForm.tsx to:
      • Handle steam-auth-error messages.
      • Log error messages and reset the popup state accordingly.

Issue Addressed

Expected Outcome

With these changes, once a user links their Steam account, this link should be maintained across sessions independently of the cookie's existence. This will enhance the user experience by eliminating the need to frequently relink the Steam account and ensure data consistency across our systems.

Additional Notes

This change aligns the Steam linking functionality with our existing user data management practices and provides a smoother and more reliable user experience.

The consumed API endpoint implementation can be found here: https://github.com/imperfectandcompany/Imperfect-Gamers-API/pull/2