mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 08:09:37 +00:00
Passwort recovery and change
This commit is contained in:
parent
1faebfc217
commit
9f2a155fe0
12
app.py
12
app.py
@ -13,7 +13,7 @@ from flask_cors import CORS
|
||||
import pytz
|
||||
import json
|
||||
from flask_qrcode import QRcode
|
||||
from flask_mail import Mail, Message
|
||||
from flask_mail import Mail, Message, email_dispatched
|
||||
|
||||
# Create app
|
||||
app = Flask(__name__)
|
||||
@ -23,6 +23,9 @@ app.config['SECURITY_CONFIRMABLE'] = False
|
||||
app.config['SECURITY_TRACKABLE'] = True
|
||||
app.config['SECURITY_REGISTERABLE'] = True
|
||||
app.config['SECURITY_SEND_REGISTER_EMAIL'] = False
|
||||
app.config['SECURITY_RECOVERABLE'] = True
|
||||
app.config['SECURITY_CHANGEABLE'] = True
|
||||
app.config['SECURITY_EMAIL_SENDER'] = os.getenv("MAIL_DEFAULT_SENDER")
|
||||
app.config['LANGUAGES'] = ['en', 'de']
|
||||
app.config['GOOGLE_OAUTH_CLIENT_ID'] = os.getenv('GOOGLE_OAUTH_CLIENT_ID')
|
||||
app.config['GOOGLE_OAUTH_CLIENT_SECRET'] = os.getenv('GOOGLE_OAUTH_CLIENT_SECRET')
|
||||
@ -46,6 +49,7 @@ mail_server = os.getenv("MAIL_SERVER")
|
||||
|
||||
if mail_server is None:
|
||||
app.config['MAIL_SUPPRESS_SEND'] = True
|
||||
app.config['MAIL_DEFAULT_SENDER'] = 'test@oveda.de'
|
||||
else:
|
||||
app.config['MAIL_SUPPRESS_SEND'] = False
|
||||
app.config['MAIL_SERVER'] = mail_server
|
||||
@ -58,6 +62,12 @@ else:
|
||||
|
||||
mail = Mail(app)
|
||||
|
||||
if app.config['MAIL_SUPPRESS_SEND']:
|
||||
def log_message(message, app):
|
||||
print(message.subject)
|
||||
print(message.body)
|
||||
email_dispatched.connect(log_message)
|
||||
|
||||
# create db
|
||||
db = SQLAlchemy(app)
|
||||
|
||||
|
||||
@ -7,6 +7,9 @@
|
||||
|
||||
<h1>{{ current_user.email }}</h1>
|
||||
|
||||
<h2>{{ _('Profile') }}</h2>
|
||||
<p><a href="{{ url_for_security('change_password') }}">{{ _fsdomain('Change password') }}</a></p>
|
||||
|
||||
{% if invitations %}
|
||||
<h2>{{ _('Invitations') }}</h2>
|
||||
<div class="table-responsive">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user