Check for a `Hash` when using the `authentication_keys` to generate the FailureApp flash message.

Fixes #3270.