add logic so front end has user logged in persistence