diff --git a/app.py b/app.py index 6d1bf8a..1e59d45 100644 --- a/app.py +++ b/app.py @@ -8,7 +8,7 @@ logging.basicConfig(level=logging.INFO) -app = Flask(__name__) +app = Flask(__name__, static_url_path='/static') app.register_blueprint(oauth2_blueprint) app.secret_key = 'some_secure_random_string' # Please use a secure secret key in production diff --git a/static/js/main.js b/static/js/main.js new file mode 100644 index 0000000..b53861c --- /dev/null +++ b/static/js/main.js @@ -0,0 +1,10 @@ +document.addEventListener('DOMContentLoaded', function() { + fetch('/is_authenticated') + .then(response => response.json()) + .then(data => { + if (data.authenticated) { + document.getElementById('authButton').style.display = 'none'; + document.getElementById('syncForm').style.display = 'block'; + } + }); +}); diff --git a/templates/base.html b/templates/base.html index f3959de..0be72b9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,6 +7,7 @@