Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

REST login_url for external frontend #81

Open
rubengrill opened this issue Sep 6, 2018 · 0 comments
Open

REST login_url for external frontend #81

rubengrill opened this issue Sep 6, 2018 · 0 comments

Comments

@rubengrill
Copy link
Contributor

In #79 the LoginForm.save() accepts a parameter login_code_url with a default value of login_code_url, that will be used for reversing a url for the link in the email.

This means that a vendor either has to include both urls, or to provide a custom view just to have a matching url:

# include both urls, to handle the `login_code` server side, not via frontend
path('accounts/', include('nopassword.urls')),
path('api/accounts/', include('nopassword.rest.urls')),

# custom view, the url matches the url routing in the frontend application
path('accounts/login/code/', TemplateView.as_view(template_name='index.html'), name='login_code'),
path('api/accounts/', include('nopassword.rest.urls')),

It would be better if the vendor doesn't have to provide a custom view or to include both regular + rest views.
Maybe we should introduce some setting NOPASSWORD_LOGIN_CODE_URL, similar to django default setting LOGIN_URL, it could also be a url name or an actual url (anything that resolve supports).
This way, we would also support that the api and frontend are running on different machines, and the NOPASSWORD_LOGIN_CODE_URL would point to a url on a different server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant