allows user to login after 1 failed attempt

I added a feature to allow the user to login after 1 failed attempt. The problem is that this program relies on an internet connection to upload the picture and goelocation coordinates. How would we achieve that without an internet connection? The solution is to allow the user to enter upon one failed attempt.