danihodovic / django-allauth-ui

Nice looking templates for django-allauth
https://django-allauth-ui.hodovi.ch
MIT License
238 stars 26 forks source link

form url in login.html is never set #94

Closed vdejager closed 4 weeks ago

vdejager commented 1 month ago

In the login.html there are two lines defining the form post url:

https://github.com/danihodovic/django-allauth-ui/blob/3df6ee1b41dc30ef1a2f2e26a87a5bb059cbae47/allauth_ui/templates/account/login.html#L13-L14

I think the 'url' in the form tag definition should be 'login_url'. the formtag action thus now always renders as "" since 'url' is not defined.

I ran into this when displaying the form via a htmx get request to "/account/login/". The login form nicely gets swapped in, but action="" now refers to the page where the htmx tag is located ("/" in my case) and the POST never logs the user in. (it posts to "/" and never redirects to whatver LOGIN_REDIRECT_URL is set

If you use allauth normally by calling "/account/login/", that URL will be the default page for action="" and silently still logs in the user

geoffbeier commented 1 month ago

I didn't notice this issue before I opened #96.

PR #97 should also fix this one.