Pass err to authenticate
Merge pull request #3 from cheung31/master

Pass err to authenticate