struct ExceptionalResponse <: Exception
A type of exception which wraps an HTTP Response object. The thrown exception will propagate until it is caught up the app stack or ultimately by Genie and the wrapped response is sent to the client.
If the user is not authenticated, an
ExceptionalResponse is thrown - if the exception is not caught in the app's stack, Genie will catch it and return the wrapped
Response object, forcing an HTTP redirect to the login page.
isauthenticated() || throw(ExceptionalResponse(redirect(:show_login)))