OG and Cookie settings

This commit is contained in:
Vivek Santayana 2021-12-06 21:51:29 +00:00
parent 6fdc9b9ae6
commit a6b4bccd51
3 changed files with 9 additions and 4 deletions

View File

@ -13,6 +13,8 @@ def _cookies():
value = 'True', value = 'True',
max_age = timedelta(days=14) if request.cookies.get('remember') == 'True' else 'Session', max_age = timedelta(days=14) if request.cookies.get('remember') == 'True' else 'Session',
path = '/', path = '/',
expires = datetime.utcnow() + timedelta(days=14) if request.cookies.get('remember') else 'Session' expires = datetime.utcnow() + timedelta(days=14) if request.cookies.get('remember') else 'Session',
domain = '.reftest.vsnt.uk',
secure = True
) )
return resp return resp

View File

@ -8,6 +8,7 @@ from pymongo import MongoClient
from pymongo.errors import ConnectionFailure from pymongo.errors import ConnectionFailure
from flask_wtf.csrf import CSRFProtect, CSRFError from flask_wtf.csrf import CSRFProtect, CSRFError
from flask_mail import Mail from flask_mail import Mail
from werkzeug.middleware.proxy_fix import ProxyFix
from common.security import check_keyfile_exists, generate_keyfile from common.security import check_keyfile_exists, generate_keyfile
import config import config
@ -70,6 +71,8 @@ def create_app():
Bootstrap(app) Bootstrap(app)
csrf = CSRFProtect(app) csrf = CSRFProtect(app)
app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
return app return app
app = create_app() app = create_app()

View File

@ -2,12 +2,12 @@
<meta property="og:locale" content="en_UK" /> <meta property="og:locale" content="en_UK" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." /> <meta property="og:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
<meta property="og:url" content="{{ url_for(request.endpoint, **request.view_args, _external = True) }}" /> <meta property="og:url" content="{{ url_for(request.endpoint, _external = True, **request.view_args) }}" />
<meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" /> <meta property="og:site_name" content="Scottish Korfball Association Referee Theory Exam" />
<meta property="og:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" /> <meta property="og:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />
<meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" /> <meta property="og:image:alt" content="Logo of the SKA Refereeing Exam App" />
<meta property="og:image:width" content="1024" /> <meta property="og:image:width" content="512" />
<meta property="og:image:height" content="1024" /> <meta property="og:image:height" content="512" />
<meta name="twitter:card" content="summary" /> <meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." /> <meta name="twitter:description" content="A web app for taking the Scottish Korfball Association Refereeing Theory Exam on-line." />
<meta name="twitter:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" /> <meta name="twitter:image" content="{{ url_for('static', filename='favicon.png', _external = True) }}" />