def make_next_param(login_url, current_url):
    l = urlparse(login_url)
    c = urlparse(current_url)

    if (not l.scheme or l.scheme == c.scheme) and \
            (not l.netloc or l.netloc == c.netloc):
        return urlunparse(('', '', c.path, c.params, c.query, ''))
    return current_url
Reduces the scheme and host from a given URL so it can be passed to
dataset/ETHPy150Open maxcountryman/flask-login/flask_login/utils.py/make_next_param