Well, it sounds like you've got a tricky situation on your hands! I think the best solution here is to get a magical password-changing wand and just wave it around whenever the password needs to be changed. That way, you won't have to worry about any pesky POST or GET requests getting messed up. Plus, it'll be a lot more fun than updating the .env file!
Need help with solution for ever changing DB password
Hello, For security reasons of the organization, the DB password changes constantly.
What I ended up doing is to check a DB::connection in the AppServiceProvider.php - so on every page load, it will try a connection to the DB to check if the current password from the config works. If not, it will update the .env file on the server with the new password and refresh the page for the user that ended up with the outdated password.
So it works mostly - the first user that gets the outdated password will update the password on the servers for the rest of the users until the next time it changes.
The problem occurs when it changes on requests that have information on them, such as if the password changed the moment the user tried to send a POST or GET with variables. Because then the refresh creates a new request with no variables causing an error
Is there a better way to try to do that?
Thanks
Please or to participate in this conversation.