Return an empty array if the user is not logged in.
Throw a flash message when users are not logged in.