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

fix: use useSearchParams for token retrieval instead use useRouter #391

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

Yuwen-ctw
Copy link
Contributor

@Yuwen-ctw Yuwen-ctw commented Jul 14, 2024

Why need this change? / Root cause:

  • Changed implementation due to an issue where the token retrieved from query was not as expected

Changes made:

  • Replaced useRouter().query with useRouter().asPath to retrieve the token parameter

Test Scope / Change impact:

Issue

@Yuwen-ctw Yuwen-ctw added the bug Fix something in main label Jul 14, 2024
@Yuwen-ctw Yuwen-ctw requested a review from JohnsonMao July 14, 2024 11:44
@Yuwen-ctw Yuwen-ctw self-assigned this Jul 14, 2024
@JohnsonMao
Copy link
Contributor

@Yuwen-ctw 不過使用 useSearchParams 後端回傳的網址是不是就要改成 /auth/token?token=eyJhbGciO... 用 query 的方式來傳遞 token

- Replaced `useRouter().query` with `useRouter().asPath` to retrieve the `token` parameter
- Changed implementation due to an issue where the token retrieved from `query` was not as expected
@Yuwen-ctw Yuwen-ctw force-pushed the fix/unexpected-token-from-query-string branch from fe63778 to ad56691 Compare July 14, 2024 12:41
Copy link

@GaaSBot
Copy link

GaaSBot commented Jul 14, 2024

Knip Scan Result for ad56691

Unused files (9)
Unused files (9)
.bundlewatch.config.js
components/shared/Chat/ChatContent.tsx
components/shared/Chat/ChatMessage.tsx
components/shared/Chat/index.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
Unused exported types (2)
Unused exported types (2)
ChatProps type components/shared/Chat/v2/Chat.tsx
ChatHeaderProps type components/shared/Chat/v2/ChatHeader.tsx
Unused exported types in namespaces (1)
Unused exported types in namespaces (1)
BaseBoxFancyProp interface components/shared/BoxFancy/BoxFancy.tsx
Configuration issues (1)
Configuration issues (1)
Unused item in ignoreDependencies: @next/bundle-analyzer

@GaaSBot
Copy link

GaaSBot commented Jul 14, 2024

🤖 Lighthouse Scan Result for ad56691

/rooms
Metric Value
Performance 70
Seo 78
Accessibility 78
HTML Report for LHCI Scan Report Link
/rooms/abc
Metric Value
Performance 77
Seo 78
Accessibility 64
HTML Report for LHCI Scan Report Link
/login
Metric Value
Performance 74
Seo 78
Accessibility 94
HTML Report for LHCI Scan Report Link

@Yuwen-ctw
Copy link
Contributor Author

@JohnsonMao 感謝提醒,已進行修正,改使用 asPath 屬性來取得 token。

@JohnsonMao JohnsonMao merged commit a35a9b6 into main Jul 14, 2024
8 checks passed
@JohnsonMao JohnsonMao deleted the fix/unexpected-token-from-query-string branch July 14, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix something in main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix: 未知原因登入失敗
3 participants