Excess code

else block is extra code to be processed.  try block can test for authentication and return if successful all in one move.