Skip to content

Commit

Permalink
Merge pull request #26 from meowcat/main
Browse files Browse the repository at this point in the history
Fixed POST target and redirection URL, fixing #25
  • Loading branch information
simonw authored Sep 3, 2024
2 parents cf3a1d7 + e345e12 commit 0229873
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion datasette_auth_passwords/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def password_login(request, datasette):
password_hash = accounts.get(username)
if password_hash and verify_password(password, password_hash):
actor = actors.get(username) or {"id": username}
response = Response.redirect("/")
response = Response.redirect(datasette.urls.path("/"))
response.set_cookie("ds_actor", datasette.sign({"a": actor}, "actor"))
return response
else:
Expand Down
2 changes: 1 addition & 1 deletion datasette_auth_passwords/templates/password_login.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h1>Log in</h1>
<p class="message-error">{{ error }}</p>
{% endif %}

<form class="password-login" action="/-/login" method="post">
<form class="password-login" action="{{ urls.path("/-/login") }}" method="post">
<div>
<p>
<label for="id_username">Username</label>
Expand Down

0 comments on commit 0229873

Please sign in to comment.