Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Socket.IO connects with the jwt token #321

Merged
merged 5 commits into from
Sep 18, 2023
Merged

Conversation

allyusd
Copy link
Contributor

@allyusd allyusd commented Sep 16, 2023

Why need this change? / Root cause:

  • Socket.IO connects with the jwt token

Changes made:

  • When the user's token changes, Socket.IO will automatically reconnect using the new token.
  • Socker.IO dev server can get token

Test Scope / Change impact:

Issue

Note

原本的 Socket.IO 是固定參數,這次需求改為動態帶 auth token

Reference

https://socket.io/docs/v4/middlewares/#sending-credentials

@vercel
Copy link

vercel bot commented Sep 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
game-lobby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2023 8:50am

Copy link
Contributor

@Yuwen-ctw Yuwen-ctw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@JohnsonMao JohnsonMao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

pages/api/mock/socketio.ts Outdated Show resolved Hide resolved
@GaaSBot
Copy link

GaaSBot commented Sep 17, 2023

Knip Scan Result for 13dd770

Unused files (10)
Unused files (10)
.bundlewatch.config.js
components/shared/Chat/ChatContent.tsx
components/shared/Chat/ChatMessage.tsx
components/shared/Chat/index.tsx
components/shared/Icon/group/news.tsx
configs/i18nConfigs.ts
lighthouserc.js
reset.d.ts
scripts/knipScanReporter.js
scripts/lhciScanReporter.js
Unused dependencies (2)
Unused dependencies (2)
@svgr/webpack package.json
sharp package.json
Unused devDependencies (5)
Unused devDependencies (5)
@actions/github package.json
@octokit/core package.json
@storybook/blocks package.json
@storybook/testing-library package.json
@total-typescript/ts-reset package.json
Configuration issues (1)
Configuration issues (1)
Unused item in ignoreDependencies: @next/bundle-analyzer

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@GaaSBot
Copy link

GaaSBot commented Sep 17, 2023

🤖 Lighthouse Scan Result for 13dd770

/rooms
Metric Value
Performance 64
Seo 80
Accessibility 77
HTML Report for LHCI Scan Report Link
/rooms/abc
Metric Value
Performance 75
Seo 80
Accessibility 66
HTML Report for LHCI Scan Report Link
/login
Metric Value
Performance 47
Seo 80
Accessibility 94
HTML Report for LHCI Scan Report Link

@allyusd allyusd merged commit 8269dcd into main Sep 18, 2023
9 checks passed
@allyusd allyusd deleted the feat/socket-io-with-auth branch September 18, 2023 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: SocketIO 連線時帶 token 提供驗證
4 participants