mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-17 11:19:10 +08:00
Merge branch 'develop' of https://github.com/mattupstate/flask-security into develop
This commit is contained in:
+14
-19
@@ -87,43 +87,38 @@ sends the following signals.
|
||||
|
||||
.. data:: user_registered
|
||||
|
||||
Sent when a user registers on the site. It is passed a dict with
|
||||
the `user` and `confirm_token`, the user being logged in and the
|
||||
(if so configured) the confirmation token issued.
|
||||
Sent when a user registers on the site. In addition to the app (which is the
|
||||
sender), it is passed `user` and `confirm_token` arguments.
|
||||
|
||||
.. data:: user_confirmed
|
||||
|
||||
Sent when a user is confirmed. It is passed `user`, which is the
|
||||
user being confirmed.
|
||||
Sent when a user is confirmed. In addition to the app (which is the
|
||||
sender), it is passed a `user` argument.
|
||||
|
||||
.. data:: confirm_instructions_sent
|
||||
|
||||
Sent when a user requests confirmation instructions. It is passed
|
||||
the `user`.
|
||||
Sent when a user requests confirmation instructions. In addition to the app
|
||||
(which is the sender), it is passed a `user` argument.
|
||||
|
||||
.. data:: login_instructions_sent
|
||||
|
||||
Sent when passwordless login is used and user logs in. It is passed
|
||||
a dict with the `user` and `login_token`, the user being logged in
|
||||
and the (if so configured) the login token issued.
|
||||
Sent when passwordless login is used and user logs in. In addition to the app
|
||||
(which is the sender), it is passed `user` and `login_token` arguments.
|
||||
|
||||
.. data:: password_reset
|
||||
|
||||
Sent when a user completes a password reset. It is passed the
|
||||
`user`.
|
||||
Sent when a user completes a password reset. In addition to the app (which is
|
||||
the sender), it is passed a `user` argument.
|
||||
|
||||
.. data:: password_changed
|
||||
|
||||
Sent when a user completes a password change. It is passed the
|
||||
`user`.
|
||||
Sent when a user completes a password change. In addition to the app (which is
|
||||
the sender), it is passed a `user` argument.
|
||||
|
||||
.. data:: reset_password_instructions_sent
|
||||
|
||||
Sent when a user requests a password reset. It is passed a dict
|
||||
with the `user` and `token`, the user being logged in and
|
||||
the (if so configured) the reset token issued.
|
||||
Sent when a user requests a password reset. In addition to the app (which is
|
||||
the sender), it is passed `user` and `token` arguments.
|
||||
|
||||
All signals are also passed a `app` keyword argument, which is the
|
||||
current application.
|
||||
|
||||
.. _Flask documentation on signals: http://flask.pocoo.org/docs/signals/
|
||||
|
||||
+11
-3
@@ -23,7 +23,10 @@ Core
|
||||
passwords. Recommended values for
|
||||
production systems are ``bcrypt``,
|
||||
``sha512_crypt``, or ``pbkdf2_sha512``.
|
||||
Defaults to ``plaintext``.
|
||||
Defaults to ``plaintext``. Note:
|
||||
``bcrypt>=2.0.0`` is not currently
|
||||
supported. If ``bcrypt`` is preferred,
|
||||
please use ``bcrypt<2.0``.
|
||||
``SECURITY_PASSWORD_SALT`` Specifies the HMAC salt. This is only
|
||||
used if the password hash type is set
|
||||
to something other than plain text.
|
||||
@@ -31,12 +34,16 @@ Core
|
||||
``SECURITY_EMAIL_SENDER`` Specifies the email address to send
|
||||
emails as. Defaults to
|
||||
``no-reply@localhost``.
|
||||
``SECURITY_TOKEN_AUTHENTICATION_KEY`` Specifies the query sting parameter to
|
||||
``SECURITY_TOKEN_AUTHENTICATION_KEY`` Specifies the query string parameter to
|
||||
read when using token authentication.
|
||||
Defaults to ``auth_token``.
|
||||
``SECURITY_TOKEN_AUTHENTICATION_HEADER`` Specifies the HTTP header to read when
|
||||
using token authentication. Defaults to
|
||||
``Authentication-Token``.
|
||||
``SECURITY_TOKEN_MAX_AGE`` Specifies the number of seconds before
|
||||
an authentication token expires.
|
||||
Defaults to None, meaning the token
|
||||
never expires.
|
||||
``SECURITY_DEFAULT_HTTP_AUTH_REALM`` Specifies the default authentication
|
||||
realm when using basic HTTP auth.
|
||||
Defaults to ``Login Required``
|
||||
@@ -159,7 +166,8 @@ Feature Flags
|
||||
option. Defaults to ``False``.
|
||||
``SECURITY_TRACKABLE`` Specifies if Flask-Security should track basic user
|
||||
login statistics. If set to ``True``, ensure your
|
||||
models have the required fields/attribues. Defaults to
|
||||
models have the required fields/attribues. Be sure to
|
||||
use `ProxyFix <http://flask.pocoo.org/docs/0.10/deploying/wsgi-standalone/#proxy-setups>` if you are using a proxy. Defaults to
|
||||
``False``
|
||||
``SECURITY_PASSWORDLESS`` Specifies if Flask-Security should enable the
|
||||
passwordless login feature. If set to ``True``, users
|
||||
|
||||
@@ -73,8 +73,8 @@ register form or override validators::
|
||||
from flask_security.forms import RegisterForm
|
||||
|
||||
class ExtendedRegisterForm(RegisterForm):
|
||||
first_name = TextField('First Name', [Required()])
|
||||
last_name = TextField('Last Name', [Required()])
|
||||
first_name = StringField('First Name', [Required()])
|
||||
last_name = StringField('Last Name', [Required()])
|
||||
|
||||
security = Security(app, user_datastore,
|
||||
register_form=ExtendedRegisterForm)
|
||||
|
||||
Reference in New Issue
Block a user