usage of localStorage to prevent login on page reload