security: filter out master_session if it's set to None
#492
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.
Closes #491
The resulting security page when impersonating users:
![image](https://private-user-images.githubusercontent.com/6437519/368737329-48f09891-8224-4810-bac3-152f36e72f95.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4Mjg4MTYsIm5iZiI6MTczODgyODUxNiwicGF0aCI6Ii82NDM3NTE5LzM2ODczNzMyOS00OGYwOTg5MS04MjI0LTQ4MTAtYmFjMy0xNTJmMzZlNzJmOTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDZUMDc1NTE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjkzMzQ1OTY5OTFhZTVmZmQyYzgzMTg4Y2M3OTYwMGM1NmI1MmQ0MzFmYjYyOGY0ODc4OGRkMjcyOGFjZGVkNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.hcQjaWupTR1zmZLVt1SATwlM3LeL80-y9L7q1w-jddY)
It may look a little strange, but i consider that better than a 500 internal server error 😄