FelipePSoares / EconoFlow

An easy system to help you control your personal or company budget.
https://econoflow.pt/
MIT License
3 stars 3 forks source link

[Backend] Persist User Sessions Across Deployments #173

Closed FelipePSoares closed 1 month ago

FelipePSoares commented 1 month ago

To prevent users from having to log in after every deployment, we need to store Data Protection keys in SQL Server.

We will follow the guidance from this documentation, and the best approach for us is to create a dedicated DbContext for managing these keys.

For production, we can leverage the existing environment variable EconoFlow_THUMBPRINT to encrypt the keys stored in the database. Ensure that encryption is only applied in the production environment by checking app.Environment.IsDevelopment().

Additionally, make sure Cypress tests continue to run smoothly after this change, as they should not be disrupted by the new key storage approach.