Return error/result in authentication block