Skip to content

Commit 589e2b2

Browse files
author
georgiy.rusanov
committed
debug
1 parent 6530286 commit 589e2b2

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,25 @@ jobs:
162162
const joinMessage = JSON.stringify({
163163
topic: 'realtime:test-channel',
164164
event: 'phx_join',
165-
payload: { config: { broadcast: { self: false }, presence: { key: '' }, private: false } },
165+
payload: {
166+
config: { broadcast: { self: false }, presence: { key: '' }, private: false },
167+
access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0'
168+
},
166169
ref: '1'
167170
});
168-
console.log('Sending join message:', joinMessage);
171+
console.log('Sending join message with full payload:');
172+
console.log(JSON.stringify(JSON.parse(joinMessage), null, 2));
169173
ws.send(joinMessage);
170174
});
171175
172176
ws.on('message', (data) => {
173177
console.log('Received message:', data.toString());
178+
try {
179+
const parsed = JSON.parse(data.toString());
180+
console.log('Parsed message:', JSON.stringify(parsed, null, 2));
181+
} catch (e) {
182+
console.log('Could not parse message as JSON');
183+
}
174184
});
175185
176186
ws.on('error', (error) => {
@@ -187,6 +197,22 @@ jobs:
187197
}, 5000);
188198
" || echo "Node.js WebSocket test failed"
189199
200+
echo "Testing JWT token validation"
201+
node -e "
202+
const jwt = require('jsonwebtoken');
203+
204+
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0';
205+
const secret = 'super-secret-jwt-token-with-at-least-32-characters-long';
206+
207+
try {
208+
const decoded = jwt.verify(token, secret);
209+
console.log('JWT token is valid');
210+
console.log('Decoded payload:', JSON.stringify(decoded, null, 2));
211+
} catch (error) {
212+
console.log('JWT token validation failed:', error.message);
213+
}
214+
" || echo "JWT validation test failed"
215+
190216
docker ps --format '{{.Names}}'
191217
192218
echo "docker logs"

0 commit comments

Comments
 (0)