adding password encryption to increase security
This commit is contained in:
parent
041b490e7f
commit
023eb1529e
1 changed files with 73 additions and 68 deletions
|
@ -9,6 +9,7 @@ import urllib
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from bs4 import BeautifulSoup as BS
|
from bs4 import BeautifulSoup as BS
|
||||||
from xml.sax.saxutils import escape
|
from xml.sax.saxutils import escape
|
||||||
|
from flask.ext.security.utils import encrypt_password
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -19,7 +20,8 @@ app.config["MONGODB_DB"] = "bookie"
|
||||||
app.config['SECRET_KEY'] = 'bobloblawlawblog'
|
app.config['SECRET_KEY'] = 'bobloblawlawblog'
|
||||||
app.config['UPLOAD_FOLDER'] = "static/uploads"
|
app.config['UPLOAD_FOLDER'] = "static/uploads"
|
||||||
app.config['SITE_URL'] = "http://localhost:5000"
|
app.config['SITE_URL'] = "http://localhost:5000"
|
||||||
|
app.config['SECURITY_PASSWORD_HASH'] = "bcrypt"
|
||||||
|
app.config['SECURITY_PASSWORD_SALT'] = "asdfiqwnvonaosinva"
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# MongoDB Setup
|
# MongoDB Setup
|
||||||
|
@ -42,6 +44,9 @@ class User(db.Document, UserMixin):
|
||||||
confirmed_at = db.DateTimeField()
|
confirmed_at = db.DateTimeField()
|
||||||
roles = db.ListField(db.ReferenceField(Role), default=[])
|
roles = db.ListField(db.ReferenceField(Role), default=[])
|
||||||
|
|
||||||
|
def encrypt_password(self, pw):
|
||||||
|
return encrypt_password(pw)
|
||||||
|
|
||||||
class Tag(db.Document):
|
class Tag(db.Document):
|
||||||
name = db.StringField(required=True, max_length=25, unique=True)
|
name = db.StringField(required=True, max_length=25, unique=True)
|
||||||
note = db.StringField(required=False, max_length=100)
|
note = db.StringField(required=False, max_length=100)
|
||||||
|
|
Loading…
Reference in a new issue