Skip to content

class Athena::Security::Exception::CustomUserMessageAuthentication
inherits Athena::Security::Exception::Authentication #

An authentication exception whose message is shown to the user.

Warning

Make sure the message is safe to show to users, e.g. do not pass the message of another exception.

Constructors#

.new(message : String = "", message_data : Hash(String, String) = {} of String => String, cause : ::Exception | Nil = nil)#

View source

Methods#

#message_data : Hash(String, String)#

Returns the data to interpolate into the #message_key.

View source

#message_key : String#

Returns a message describing why the user could not be authenticated, which is safe to show to users.

View source

#set_safe_message(message_key : String, message_data : Hash(String, String) = {} of String => String) : Nil#

Sets the message_key shown to users, and the message_data to interpolate into it.

View source