Skip to content

Commit

Permalink
Add some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
justinh-rahb committed Aug 18, 2023
1 parent 09fc3ca commit fe2d8b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions static/js/main.js
Original file line number Diff line number Diff line change
@@ -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';
}
});
});
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>Constant Sync</title>
<!-- Bootstrap CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<script src="{{ url_for('static', filename='js/main.js') }}"></script>
</head>
<body>

Expand Down

0 comments on commit fe2d8b4

Please sign in to comment.