Skip to content

Commit 7742919

Browse files
Proper Error raise in Reauthentication Form
1 parent 6cfdee7 commit 7742919

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

warehouse/accounts/views.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ def login(request, redirect_field_name=REDIRECT_FIELD_NAME, _form_class=LoginFor
297297
breach_service=breach_service,
298298
check_password_metrics_tags=["method:auth", "auth_method:login_form"],
299299
)
300-
301300
if request.method == "POST":
302301
if form.validate():
303302
# Get the user id for the given username.
@@ -1458,6 +1457,7 @@ def profile_public_email(user, request):
14581457

14591458
@view_config(
14601459
route_name="accounts.reauthenticate",
1460+
renderer="re-auth.html",
14611461
uses_session=True,
14621462
require_csrf=True,
14631463
require_methods=False,
@@ -1494,14 +1494,16 @@ def reauthenticate(request, _form_class=ReAuthenticateForm):
14941494
redirect_to = request.route_path("manage.projects")
14951495

14961496
resp = HTTPSeeOther(redirect_to)
1497-
14981497
if request.method == "POST" and form.validate():
14991498
request.session.record_auth_timestamp()
15001499
request.session.record_password_timestamp(
15011500
user_service.get_password_timestamp(request.user.id)
15021501
)
1502+
return resp
15031503

1504-
return resp
1504+
return {
1505+
"form": form,
1506+
}
15051507

15061508

15071509
@view_defaults(

0 commit comments

Comments
 (0)