diff --git a/nginx/nexus-pos.conf b/nginx/nexus-pos.conf index 1c9195f..d98ba4e 100644 --- a/nginx/nexus-pos.conf +++ b/nginx/nexus-pos.conf @@ -74,7 +74,7 @@ server { } location = / { - return 302 /pos/login?v=34; + return 302 /pos/login2; } location / { diff --git a/pos/app.py b/pos/app.py index 3323b21..c5032e6 100644 --- a/pos/app.py +++ b/pos/app.py @@ -144,15 +144,15 @@ def create_app(): return send_from_directory('static/pwa', 'icon-192.png', mimetype='image/png') @app.route('/pos/login') - def pos_login(): - # Bust browser cache by always serving the login page under a versioned URL. - if request.args.get('v') != '34': - response = make_response(redirect('/pos/login?v=34')) - response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0' - response.headers['Pragma'] = 'no-cache' - response.headers['Expires'] = '0' - return response + def pos_login_legacy(): + # Redirect to the new login path to bypass any stale browser/SW cache + # of the old /pos/login page that did not send employee_id. + response = make_response(redirect('/pos/login2')) + response.headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=0' + return response + @app.route('/pos/login2') + def pos_login(): response = make_response(render_template('login.html', tenant_id=getattr(g, 'tenant_id', None), tenant_name=getattr(g, 'tenant_name', None),