Use maybeApplication in CSRF and Crypto
Merge pull request #3132 from gmethvin/maybe_application

Use maybeApplication in CSRF and Crypto