Twig function to check auth

Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>