Customised user callbacks

I wish to call a visual effect based on whether a user is authenticated.
there is an if statement controlling the user authentication which
resides in my controller. If the statement fails I wish to call the
visual effect method. currently, there is no suitable callback for what
I need. Is there a way I can define my own custom user callback which
is fired like an event from the controller?