Skip to content

Field Error in Reauthentication Form #17681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
70b4da3
WIP
dakshbhayana11811137 Feb 19, 2025
773fedc
Replacing Fixtures with Constants
dakshbhayana11811137 Feb 20, 2025
2ccb5bf
Replacing Fixtures with Constants
dakshbhayana11811137 Feb 20, 2025
d098d3e
Reformat and Linting
dakshbhayana11811137 Feb 20, 2025
a12c27c
Merge branch 'main' into main
Daksh2000 Feb 20, 2025
b150dfc
Reformat constants file
dakshbhayana11811137 Feb 20, 2025
2cbbf94
Test Case Fix
dakshbhayana11811137 Feb 20, 2025
3f37f99
Merge remote-tracking branch 'refs/remotes/origin/main'
dakshbhayana11811137 Feb 20, 2025
143eec9
Workflows Fix
dakshbhayana11811137 Feb 20, 2025
0dcca75
Merge branch 'main' into main
Daksh2000 Feb 22, 2025
2e6df31
Removed fixtures and added comments to constants
dakshbhayana11811137 Feb 23, 2025
6880f29
Merge remote-tracking branch 'refs/remotes/origin/main'
dakshbhayana11811137 Feb 23, 2025
6cfdee7
Remaining Test Case Fix
dakshbhayana11811137 Feb 24, 2025
3956b92
Merge branch 'main' into main
miketheman Feb 25, 2025
7742919
Proper Error raise in Reauthentication Form
dakshbhayana11811137 Feb 28, 2025
06508d1
Merge remote-tracking branch 'refs/remotes/origin/main'
dakshbhayana11811137 Feb 28, 2025
8cdaeb6
Pull from main
dakshbhayana11811137 Feb 28, 2025
f55f339
Proper Error raise in Reauthentication Form
dakshbhayana11811137 Feb 28, 2025
9a8ce0f
Merge branch 'main' into dev_test
Daksh2000 Mar 9, 2025
344784f
Merge branch 'pypi:main' into main
Daksh2000 Mar 18, 2025
14f6547
WIP: Ran make translations
dakshbhayana11811137 Mar 19, 2025
dfcdab7
Merge branch 'pypi:main' into main
Daksh2000 Mar 19, 2025
d23a701
WIP: Ran make translations
dakshbhayana11811137 Mar 19, 2025
e7918ad
WIP: Ran make translations
dakshbhayana11811137 Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions warehouse/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ def login(request, redirect_field_name=REDIRECT_FIELD_NAME, _form_class=LoginFor
breach_service=breach_service,
check_password_metrics_tags=["method:auth", "auth_method:login_form"],
)

if request.method == "POST":
if form.validate():
# Get the user id for the given username.
Expand Down Expand Up @@ -1512,6 +1511,7 @@ def profile_public_email(user, request):

@view_config(
route_name="accounts.reauthenticate",
renderer="re-auth.html",
uses_session=True,
require_csrf=True,
require_methods=False,
Expand Down Expand Up @@ -1548,14 +1548,16 @@ def reauthenticate(request, _form_class=ReAuthenticateForm):
redirect_to = request.route_path("manage.projects")

resp = HTTPSeeOther(redirect_to)

if request.method == "POST" and form.validate():
request.session.record_auth_timestamp()
request.session.record_password_timestamp(
user_service.get_password_timestamp(request.user.id)
)
return resp

return resp
return {
"form": form,
}


@view_defaults(
Expand Down
100 changes: 50 additions & 50 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -144,185 +144,185 @@ msgid ""
" ${ip})"
msgstr ""

#: warehouse/accounts/views.py:395 warehouse/accounts/views.py:464
#: warehouse/accounts/views.py:466 warehouse/accounts/views.py:495
#: warehouse/accounts/views.py:497 warehouse/accounts/views.py:603
#: warehouse/accounts/views.py:394 warehouse/accounts/views.py:463
#: warehouse/accounts/views.py:465 warehouse/accounts/views.py:494
#: warehouse/accounts/views.py:496 warehouse/accounts/views.py:602
msgid "Invalid or expired two factor login."
msgstr ""

#: warehouse/accounts/views.py:458
#: warehouse/accounts/views.py:457
msgid "Already authenticated"
msgstr ""

#: warehouse/accounts/views.py:538
#: warehouse/accounts/views.py:537
msgid "Successful WebAuthn assertion"
msgstr ""

#: warehouse/accounts/views.py:635 warehouse/manage/views/__init__.py:881
#: warehouse/accounts/views.py:634 warehouse/manage/views/__init__.py:881
msgid "Recovery code accepted. The supplied code cannot be used again."
msgstr ""

#: warehouse/accounts/views.py:727
#: warehouse/accounts/views.py:726
msgid ""
"New user registration temporarily disabled. See https://pypi.org/help"
"#admin-intervention for details."
msgstr ""

#: warehouse/accounts/views.py:869
#: warehouse/accounts/views.py:868
msgid "Expired token: request a new password reset link"
msgstr ""

#: warehouse/accounts/views.py:871
#: warehouse/accounts/views.py:870
msgid "Invalid token: request a new password reset link"
msgstr ""

#: warehouse/accounts/views.py:873 warehouse/accounts/views.py:974
#: warehouse/accounts/views.py:1078 warehouse/accounts/views.py:1247
#: warehouse/accounts/views.py:872 warehouse/accounts/views.py:973
#: warehouse/accounts/views.py:1077 warehouse/accounts/views.py:1246
msgid "Invalid token: no token supplied"
msgstr ""

#: warehouse/accounts/views.py:877
#: warehouse/accounts/views.py:876
msgid "Invalid token: not a password reset token"
msgstr ""

#: warehouse/accounts/views.py:882
#: warehouse/accounts/views.py:881
msgid "Invalid token: user not found"
msgstr ""

#: warehouse/accounts/views.py:893
#: warehouse/accounts/views.py:892
msgid "Invalid token: user has logged in since this token was requested"
msgstr ""

#: warehouse/accounts/views.py:911
#: warehouse/accounts/views.py:910
msgid ""
"Invalid token: password has already been changed since this token was "
"requested"
msgstr ""

#: warehouse/accounts/views.py:942
#: warehouse/accounts/views.py:941
msgid "You have reset your password"
msgstr ""

#: warehouse/accounts/views.py:970
#: warehouse/accounts/views.py:969
msgid "Expired token: request a new email verification link"
msgstr ""

#: warehouse/accounts/views.py:972
#: warehouse/accounts/views.py:971
msgid "Invalid token: request a new email verification link"
msgstr ""

#: warehouse/accounts/views.py:978
#: warehouse/accounts/views.py:977
msgid "Invalid token: not an email verification token"
msgstr ""

#: warehouse/accounts/views.py:987
#: warehouse/accounts/views.py:986
msgid "Email not found"
msgstr ""

#: warehouse/accounts/views.py:990
#: warehouse/accounts/views.py:989
msgid "Email already verified"
msgstr ""

#: warehouse/accounts/views.py:1008
#: warehouse/accounts/views.py:1007
msgid "You can now set this email as your primary address"
msgstr ""

#: warehouse/accounts/views.py:1011
#: warehouse/accounts/views.py:1010
msgid "This is your primary address"
msgstr ""

#: warehouse/accounts/views.py:1017
#: warehouse/accounts/views.py:1016
#, python-brace-format
msgid "Email address ${email_address} verified. ${confirm_message}."
msgstr ""

#: warehouse/accounts/views.py:1074
#: warehouse/accounts/views.py:1073
msgid "Expired token: request a new organization invitation"
msgstr ""

#: warehouse/accounts/views.py:1076
#: warehouse/accounts/views.py:1075
msgid "Invalid token: request a new organization invitation"
msgstr ""

#: warehouse/accounts/views.py:1082
#: warehouse/accounts/views.py:1081
msgid "Invalid token: not an organization invitation token"
msgstr ""

#: warehouse/accounts/views.py:1086
#: warehouse/accounts/views.py:1085
msgid "Organization invitation is not valid."
msgstr ""

#: warehouse/accounts/views.py:1095
#: warehouse/accounts/views.py:1094
msgid "Organization invitation no longer exists."
msgstr ""

#: warehouse/accounts/views.py:1147
#: warehouse/accounts/views.py:1146
#, python-brace-format
msgid "Invitation for '${organization_name}' is declined."
msgstr ""

#: warehouse/accounts/views.py:1210
#: warehouse/accounts/views.py:1209
#, python-brace-format
msgid "You are now ${role} of the '${organization_name}' organization."
msgstr ""

#: warehouse/accounts/views.py:1243
#: warehouse/accounts/views.py:1242
msgid "Expired token: request a new project role invitation"
msgstr ""

#: warehouse/accounts/views.py:1245
#: warehouse/accounts/views.py:1244
msgid "Invalid token: request a new project role invitation"
msgstr ""

#: warehouse/accounts/views.py:1251
#: warehouse/accounts/views.py:1250
msgid "Invalid token: not a collaboration invitation token"
msgstr ""

#: warehouse/accounts/views.py:1255
#: warehouse/accounts/views.py:1254
msgid "Role invitation is not valid."
msgstr ""

#: warehouse/accounts/views.py:1270
#: warehouse/accounts/views.py:1269
msgid "Role invitation no longer exists."
msgstr ""

#: warehouse/accounts/views.py:1302
#: warehouse/accounts/views.py:1301
#, python-brace-format
msgid "Invitation for '${project_name}' is declined."
msgstr ""

#: warehouse/accounts/views.py:1368
#: warehouse/accounts/views.py:1367
#, python-brace-format
msgid "You are now ${role} of the '${project_name}' project."
msgstr ""

#: warehouse/accounts/views.py:1448
#: warehouse/accounts/views.py:1447
#, python-brace-format
msgid "Please review our updated <a href=\"${tos_url}\">Terms of Service</a>."
msgstr ""

#: warehouse/accounts/views.py:1660 warehouse/accounts/views.py:1902
#: warehouse/accounts/views.py:1662 warehouse/accounts/views.py:1904
#: warehouse/manage/views/__init__.py:1419
msgid ""
"Trusted publishing is temporarily disabled. See https://pypi.org/help"
"#admin-intervention for details."
msgstr ""

#: warehouse/accounts/views.py:1681
#: warehouse/accounts/views.py:1683
msgid "disabled. See https://pypi.org/help#admin-intervention for details."
msgstr ""

#: warehouse/accounts/views.py:1697
#: warehouse/accounts/views.py:1699
msgid ""
"You must have a verified email in order to register a pending trusted "
"publisher. See https://pypi.org/help#openid-connect for details."
msgstr ""

#: warehouse/accounts/views.py:1710
#: warehouse/accounts/views.py:1712
msgid "You can't register more than 3 pending trusted publishers at once."
msgstr ""

#: warehouse/accounts/views.py:1725 warehouse/manage/views/__init__.py:1600
#: warehouse/accounts/views.py:1727 warehouse/manage/views/__init__.py:1600
#: warehouse/manage/views/__init__.py:1715
#: warehouse/manage/views/__init__.py:1829
#: warehouse/manage/views/__init__.py:1941
Expand All @@ -331,29 +331,29 @@ msgid ""
"again later."
msgstr ""

#: warehouse/accounts/views.py:1735 warehouse/manage/views/__init__.py:1613
#: warehouse/accounts/views.py:1737 warehouse/manage/views/__init__.py:1613
#: warehouse/manage/views/__init__.py:1728
#: warehouse/manage/views/__init__.py:1842
#: warehouse/manage/views/__init__.py:1954
msgid "The trusted publisher could not be registered"
msgstr ""

#: warehouse/accounts/views.py:1750
#: warehouse/accounts/views.py:1752
msgid ""
"This trusted publisher has already been registered. Please contact PyPI's"
" admins if this wasn't intentional."
msgstr ""

#: warehouse/accounts/views.py:1777
#: warehouse/accounts/views.py:1779
msgid "Registered a new pending publisher to create "
msgstr ""

#: warehouse/accounts/views.py:1915 warehouse/accounts/views.py:1928
#: warehouse/accounts/views.py:1935
#: warehouse/accounts/views.py:1917 warehouse/accounts/views.py:1930
#: warehouse/accounts/views.py:1937
msgid "Invalid publisher ID"
msgstr ""

#: warehouse/accounts/views.py:1942
#: warehouse/accounts/views.py:1944
msgid "Removed trusted publisher for project "
msgstr ""

Expand Down