fix(api keys): robust to replay of provisioned URL #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had an issue where if someone made a duplicate request with the steam OID url on the
provision_handler
endpoint, this would cause the DB to get a new API key but that not being displayed to the user. This fixes it by adding the hash of the OID url as a field in the api_keys table, and upon determining that the hashes of the URL's are the same, a new api key is not provisioned.Tested by running locally and refreshing the page to confirm the text is as expected and the key is not updated in the DB (nor the hash).
The only way to truly get a new key is to start at the
provision
url and run through the steam sign in again