reedit login logic