Add failure callback option to authenticate middleware