mirror of
https://github.com/TrentSPalmer/todo_app_flask.git
synced 2025-07-01 10:23:11 -07:00
Compare commits
3 Commits
4c5510b291
...
d781b1470c
Author | SHA1 | Date | |
---|---|---|---|
d781b1470c | |||
b81c6c9fa3 | |||
0dde8781ec |
@ -260,3 +260,5 @@
|
||||
"task_pkey" PRIMARY KEY, btree (id)<br />
|
||||
</p>
|
||||
|
||||
## Upgrading from Deb11 -> 12
|
||||
* install `python3-email-validator`
|
||||
|
@ -8,7 +8,7 @@ from io import BytesIO
|
||||
|
||||
|
||||
def get_totp_qr(contributor, app_config):
|
||||
totp_key = pyotp.random_base32() if contributor.totp_key is None else contributor.totp_key
|
||||
totp_key = pyotp.random_base32()[:16] if contributor.totp_key is None else contributor.totp_key
|
||||
if contributor.totp_key is None:
|
||||
conn = psycopg2.connect(
|
||||
dbname=app_config['DATABASE_NAME'],
|
||||
|
@ -54,7 +54,11 @@ class Contributor(UserMixin, db.Model):
|
||||
return '<Contributor {}>'.format(self.name)
|
||||
|
||||
def get_reset_password_token(self, expires_in=1800):
|
||||
return jwt.encode({'reset_password': self.id, 'exp': time() + expires_in}, app.config['SECRET_KEY'], algorithm='HS256').decode('utf-8')
|
||||
token = jwt.encode({'reset_password': self.id, 'exp': time() + expires_in}, app.config['SECRET_KEY'], algorithm='HS256')
|
||||
if type(token) == str:
|
||||
return token
|
||||
else:
|
||||
return token.decode('utf-8')
|
||||
|
||||
@staticmethod
|
||||
def verify_reset_password_token(token):
|
||||
|
Loading…
x
Reference in New Issue
Block a user