diff --git a/example/templates/_nav.html b/example/templates/_nav.html
index 3796955..7dd1347 100644
--- a/example/templates/_nav.html
+++ b/example/templates/_nav.html
@@ -12,7 +12,7 @@
{% endif -%}
{%- if current_user.is_authenticated() -%}
- Log out
+ Log out
{%- else -%}
Log in
{%- endif -%}
diff --git a/example/templates/login.html b/example/templates/login.html
index 137fc6c..231bb56 100644
--- a/example/templates/login.html
+++ b/example/templates/login.html
@@ -1,6 +1,6 @@
{% include "_messages.html" %}
{% include "_nav.html" %}
-
\ No newline at end of file
diff --git a/flask_security/templates/security/registrations/edit.html b/flask_security/templates/security/edit_user.html
similarity index 62%
rename from flask_security/templates/security/registrations/edit.html
rename to flask_security/templates/security/edit_user.html
index 0d5c637..7169a2c 100644
--- a/flask_security/templates/security/registrations/edit.html
+++ b/flask_security/templates/security/edit_user.html
@@ -1,7 +1,7 @@
-{% from "security/macros.html" import render_field_with_errors, render_field %}
-{% include "security/messages.html" %}
+{% from "security/_macros.html" import render_field_with_errors, render_field %}
+{% include "security/_messages.html" %}
Edit Account
-
\ No newline at end of file
diff --git a/flask_security/templates/security/logins/new.html b/flask_security/templates/security/login.html
similarity index 57%
rename from flask_security/templates/security/logins/new.html
rename to flask_security/templates/security/login.html
index a81d1fe..9d9c26f 100644
--- a/flask_security/templates/security/logins/new.html
+++ b/flask_security/templates/security/login.html
@@ -1,7 +1,7 @@
-{% from "security/macros.html" import render_field_with_errors, render_field %}
-{% include "security/messages.html" %}
+{% from "security/_macros.html" import render_field_with_errors, render_field %}
+{% include "security/_messages.html" %}
Login
-
\ No newline at end of file
diff --git a/flask_security/templates/security/passwords/new.html b/flask_security/templates/security/passwords/new.html
deleted file mode 100644
index 31c4f1f..0000000
--- a/flask_security/templates/security/passwords/new.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% from "security/macros.html" import render_field_with_errors, render_field %}
-{% include "security/messages.html" %}
-Send reset password instructions
-
\ No newline at end of file
diff --git a/flask_security/templates/security/registrations/new.html b/flask_security/templates/security/register_user.html
similarity index 58%
rename from flask_security/templates/security/registrations/new.html
rename to flask_security/templates/security/register_user.html
index b9f9773..3219472 100644
--- a/flask_security/templates/security/registrations/new.html
+++ b/flask_security/templates/security/register_user.html
@@ -1,7 +1,7 @@
-{% from "security/macros.html" import render_field_with_errors, render_field %}
-{% include "security/messages.html" %}
+{% from "security/_macros.html" import render_field_with_errors, render_field %}
+{% include "security/_messages.html" %}
Register
-
\ No newline at end of file
diff --git a/flask_security/templates/security/send_login.html b/flask_security/templates/security/send_login.html
new file mode 100644
index 0000000..7a3ea31
--- /dev/null
+++ b/flask_security/templates/security/send_login.html
@@ -0,0 +1,9 @@
+{% from "security/_macros.html" import render_field_with_errors, render_field %}
+{% include "security/_messages.html" %}
+Login
+
\ No newline at end of file
diff --git a/flask_security/utils.py b/flask_security/utils.py
index 2680ec5..42a28c7 100644
--- a/flask_security/utils.py
+++ b/flask_security/utils.py
@@ -115,6 +115,21 @@ def get_url(endpoint_or_url):
return endpoint_or_url
+def url_for_security(endpoint, **values):
+ """Return a URL for the security blueprint
+
+ :param endpoint: the endpoint of the URL (name of the function)
+ :param values: the variable arguments of the URL rule
+ :param _external: if set to `True`, an absolute URL is generated. Server
+ address can be changed via `SERVER_NAME` configuration variable which
+ defaults to `localhost`.
+ :param _anchor: if provided this is added as anchor to the URL.
+ :param _method: if provided this explicitly specifies an HTTP method.
+ """
+ endpoint = '%s.%s' % (_security.blueprint_name, endpoint)
+ return url_for(endpoint, **values)
+
+
def get_post_login_redirect():
"""Returns the URL to redirect to after a user logs in successfully."""
return (get_url(request.args.get('next')) or
diff --git a/flask_security/views.py b/flask_security/views.py
index ee3b66d..d7f6e86 100644
--- a/flask_security/views.py
+++ b/flask_security/views.py
@@ -128,7 +128,7 @@ def register_user():
return redirect(_security.post_register_view or
_security.post_login_view)
- return render_template('security/registrations/new.html',
+ return render_template('security/register_user.html',
register_user_form=form)
@@ -143,7 +143,7 @@ def send_login():
else:
do_flash(*get_message('DISABLED_ACCOUNT'))
- return render_template('security/logins/passwordless.html', login_form=form)
+ return render_template('security/send_login.html', login_form=form)
def token_login(token):
@@ -182,7 +182,7 @@ def send_confirmation():
do_flash(msg, cat)
- return render_template('security/confirmations/new.html',
+ return render_template('security/send_confirmation.html',
reset_confirmation_form=form)
@@ -231,7 +231,7 @@ def forgot_password():
for key, value in form.errors.items():
do_flash(value[0], 'error')
- return render_template('security/passwords/new.html',
+ return render_template('security/forgot_password.html',
forgot_password_form=form)
@@ -267,7 +267,7 @@ def reset_password(token):
do_flash(msg, cat)
- return render_template('security/passwords/edit.html',
+ return render_template('security/reset_password.html',
reset_password_form=form,
password_reset_token=token)