Update authentication to include returning errors