Skip to content

Commit

Permalink
Merge branch 'release-0.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Oct 30, 2023
2 parents e6424a6 + 88eca62 commit e95b034
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 133 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ Unreleased

- Remove previously deprecated code. #694


Version 0.6.3
-------------

Released 2023-10-30

- Compatibility with Flask 3 and Werkzeug 3. #813


Version 0.6.2
-------------

Expand Down
19 changes: 7 additions & 12 deletions requirements/ci-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:0f00e809355ff151ea0e49710b7f38ba949c34d6
# SHA1:da99472fcc215ae404f9516210d1a699f8ff759c
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -23,9 +23,8 @@ distlib==0.3.7
# via virtualenv
docopt==0.6.2
# via coveralls
filelock==3.13.0 ; python_version >= "3.8"
filelock==3.13.0
# via
# -r requirements/ci-tests.in
# tox
# virtualenv
idna==3.4
Expand All @@ -38,17 +37,13 @@ platformdirs==3.11.0
# via
# tox
# virtualenv
pluggy==1.3.0 ; python_version >= "3.8"
# via
# -r requirements/ci-tests.in
# tox
pyproject-api==1.6.1 ; python_version >= "3.8"
# via
# -r requirements/ci-tests.in
# tox
pluggy==1.3.0
# via tox
pyproject-api==1.6.1
# via tox
requests==2.31.0
# via coveralls
tox==4.11.3 ; python_version >= "3.8"
tox==4.11.3
# via -r requirements/ci-tests.in
urllib3==2.0.7
# via requests
Expand Down
14 changes: 5 additions & 9 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# SHA1:b1ca1a9bd816a424982c1c6f08f692b1058afbe7
# SHA1:36a6023d0127e468d03ef122f5ca862c556f8090
#
# This file is autogenerated by pip-compile-multi
# To update, run:
#
# pip-compile-multi
#
asgiref==3.5.0
asgiref==3.7.2
# via -r requirements/tests.in
blinker==1.6.3
# via -r requirements/tests.in
coverage==7.3.2 ; python_version >= "3.8"
coverage==7.3.2
# via -r requirements/tests.in
iniconfig==2.0.0
# via pytest
packaging==23.2
# via pytest
pluggy==1.3.0 ; python_version >= "3.8"
# via
# -r requirements/tests.in
# pytest
pluggy==1.3.0
# via pytest
pytest==7.4.3
# via -r requirements/tests.in
semantic-version==2.10.0
# via -r requirements/tests.in
typing-extensions==4.8.0 ; python_version >= "3.8"
# via -r requirements/tests.in
16 changes: 8 additions & 8 deletions src/flask_login/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from hashlib import sha512
from urllib.parse import parse_qs
from urllib.parse import urlencode
from urllib.parse import urlparse
from urllib.parse import urlunparse
from urllib.parse import urlsplit
from urllib.parse import urlunsplit

from flask import current_app
from flask import g
Expand Down Expand Up @@ -73,13 +73,13 @@ def make_next_param(login_url, current_url):
:param current_url: The URL to reduce.
:type current_url: str
"""
l_url = urlparse(login_url)
c_url = urlparse(current_url)
l_url = urlsplit(login_url)
c_url = urlsplit(current_url)

if (not l_url.scheme or l_url.scheme == c_url.scheme) and (
not l_url.netloc or l_url.netloc == c_url.netloc
):
return urlunparse(("", "", c_url.path, c_url.params, c_url.query, ""))
return urlunsplit(("", "", c_url.path, c_url.query, ""))
return current_url


Expand Down Expand Up @@ -122,14 +122,14 @@ def login_url(login_view, next_url=None, next_field="next"):
if next_url is None:
return base

parsed_result = urlparse(base)
md = parse_qs(parsed_result.query)
parsed_result = urlsplit(base)
md = parse_qs(parsed_result.query, keep_blank_values=True)
md[next_field] = make_next_param(base, next_url)
netloc = current_app.config.get("FORCE_HOST_FOR_REDIRECTS") or parsed_result.netloc
parsed_result = parsed_result._replace(
netloc=netloc, query=urlencode(md, doseq=True)
)
return urlunparse(parsed_result)
return urlunsplit(parsed_result)


def login_fresh():
Expand Down
Loading

0 comments on commit e95b034

Please sign in to comment.