def _login_referrer(request, params):
    """Extract a "came_from" parameter from the specified dictionary or
    just provide an URL to the home page.
    """
    return params.get('came_from', request.path)
