Commit 65ab238c authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: use App.token/App.user instead of non-existent App.getSession

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent fa7328ff
...@@ -61,14 +61,13 @@ document.addEventListener('DOMContentLoaded', function() { ...@@ -61,14 +61,13 @@ document.addEventListener('DOMContentLoaded', function() {
var code = params.get('code'); var code = params.get('code');
var matchId = params.get('id'); var matchId = params.get('id');
var session = App.getSession ? App.getSession() : null; if (!App.isLoggedIn()) {
if (!session || !session.access_token) {
window.location.href = '/login'; window.location.href = '/login';
return; return;
} }
var token = session.access_token; var token = App.token;
var userId = session.user ? session.user.id : null; var userId = App.user ? App.user.id : null;
LudoLive.setAuth(token, userId); LudoLive.setAuth(token, userId);
......
...@@ -31,13 +31,12 @@ $extraCss = ['/public/css/ludo.css']; ...@@ -31,13 +31,12 @@ $extraCss = ['/public/css/ludo.css'];
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
var session = App.getSession ? App.getSession() : null; if (!App.isLoggedIn()) {
if (!session || !session.access_token) {
window.location.href = '/login'; window.location.href = '/login';
return; return;
} }
var token = session.access_token; var token = App.token;
var timerEl = document.getElementById('mm-timer'); var timerEl = document.getElementById('mm-timer');
var startTime = Date.now(); var startTime = Date.now();
var pollInterval = null; var pollInterval = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment