From 82e5c491717d4b2a3aea4a204ad1b6c4d9628e09 Mon Sep 17 00:00:00 2001 From: Ling Thio Date: Wed, 1 Oct 2014 22:05:45 -0700 Subject: [PATCH] docs --- docs/source/api.rst | 2 ++ docs/source/customization.rst | 10 +++++++++- docs/source/includes/config_endpoints.txt | 22 ++++++++++++++++++++++ docs/source/includes/config_urls.txt | 10 ---------- docs/source/index.rst | 1 + 5 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 docs/source/includes/config_endpoints.txt diff --git a/docs/source/api.rst b/docs/source/api.rst index 9df436c8..972eee42 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -15,6 +15,8 @@ Config Settings .. include:: includes/config_urls.txt +.. include:: includes/config_endpoints.txt + .. include:: includes/config_email_templates.txt .. include:: includes/config_form_templates.txt diff --git a/docs/source/customization.rst b/docs/source/customization.rst index 1cadb588..a1a08606 100644 --- a/docs/source/customization.rst +++ b/docs/source/customization.rst @@ -14,6 +14,7 @@ behaviors that can be customized as needed: * `Password and Username validators`_ * `Password hashing`_ * `URLs`_ +* `Endpoints`_ * `Email template filenames`_ * `Form template filenames`_ * `Token generation`_ @@ -475,11 +476,18 @@ Custom view functions are specified by setting an attribute on the Flask-User's URLs ---- -Endpoint URLs can be customized through the application's config +URLs can be customized through the application's config .. include:: includes/config_urls.txt +Endpoints +--------- +Endpoints can be customized through the application's config + +.. include:: includes/config_endpoints.txt + + Email Template filenames ------------------------ Email template filenames can be customized through the application's config diff --git a/docs/source/includes/config_endpoints.txt b/docs/source/includes/config_endpoints.txt new file mode 100644 index 00000000..63ac564d --- /dev/null +++ b/docs/source/includes/config_endpoints.txt @@ -0,0 +1,22 @@ +:: + + # Endpoints are converted to URLs using url_for() + # The empty endpoint ('') will be mapped to the root URL ('/') + + # Endpoints # Default + USER_AFTER_CHANGE_PASSWORD_ENDPOINT = '' # v0.5.3 and up + USER_AFTER_CHANGE_USERNAME_ENDPOINT = '' # v0.5.3 and up + USER_AFTER_LOGIN_ENDPOINT = '' # v0.5.3 and up + USER_AFTER_LOGOUT_ENDPOINT = 'user.login' # v0.5.3 and up + USER_AFTER_REGISTER_ENDPOINT = '' # v0.5.3 and up + USER_AFTER_CONFIRM_ENDPOINT = '' # v0.5.3 and up + + # Unauthenticated users trying to access + # a view that has been decorated with @login_required or @roles_required + # will be redirected to this endpoint + USER_UNAUTHENTICATED_ENDPOINT = 'user.login' # v0.5.3 and up + + # Unauthorized users trying to access + # a view that has been decorated with @roles_required + # will be redirected to this endpoint + USER_UNAUTHORIZED_ENDPOINT = '' # v0.5.3 and up diff --git a/docs/source/includes/config_urls.txt b/docs/source/includes/config_urls.txt index 2f43e90b..c51e1e43 100644 --- a/docs/source/includes/config_urls.txt +++ b/docs/source/includes/config_urls.txt @@ -12,13 +12,3 @@ USER_REGISTER_URL = '/user/register' USER_RESEND_CONFIRM_EMAIL_URL = '/user/resend-confirm-email' # v0.5.0 and up USER_RESET_PASSWORD_URL = '/user/reset-password/' - - # Unauthenticated users trying to access a view - # that has been decorated with @login_required or @roles_required - # will be redirected to this URL - USER_UNAUTHENTICATED_URL = USER_LOGIN_URL - - # Unauthorized users trying to access a view - # that has been decorated with @roles_required - # will be redirected to this URL - USER_UNAUTHORIZED_URL = '/' diff --git a/docs/source/index.rst b/docs/source/index.rst index d02132e9..ea494ce1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -75,6 +75,7 @@ Feeling generous? `Tip me on Gittip `_ Revision History ---------------- +* v0.5.3 USER_AUTO_LOGIN_* and USER_AFTER_*_ENDPOINT settings * v0.5.2 USER_AUTO_LOGIN=True setting to auto-login already logged in users in user.login page. * v0.5.1 Support for multiple emails per user. * v0.5.0 Added ``resend_confirm_email``.