Bug: guessPotentiallyProxiedOrySdkUrl Returns Wrong SDK Url for Staging (nextJS)
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- next.js, typescript
調査の方向性
packages/elements-react/src/client/config.ts、特に guessPotentiallyProxiedOrySdkUrl から始め、packages/nextjs/src/app/login.ts からの使用箇所を追跡します。examples/nextjs-app-router で説明されている staging deployment を再現し、NEXT_PUBLIC_ORY_SDK_URL と VERCEL_URL がどのように選択されるかを調査します。staging のログインフローで設定された SDK URL が使用され、production の動作が引き続き正しい状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
I have run into an issue with the ory/nextjs package, specifically the getLoginFlow function:
We call this function when a user navigates to the login page of our site.
Under the hood it uses this function to determine the ory SDK Url:
https://github.com/ory/elements/blob/e159960474eb1351bea86afab6d930f41b4acae6/packages/elements-react/src/client/config.ts#L46
In Vercel we have a production and a staging environment. This works fine for our production environment. But in our staging environment the user is sent to the wrong link, e.g. xyz.vercel.app because the logic in this function causes the us to hit this line which sets our sdk url as the incorrect address:
if (!isProduction() && process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "")
}
But we need the request to be directed to the address we set with this variable, even in staging: NEXT_PUBLIC_ORY_SDK_URL
Always very grateful for your help and continued support 🙏
Reproducing the bug
- Clone this example project https://github.com/ory/elements/tree/main/examples/nextjs-app-router
- Publish to Github
- Link the project in vercel and create a project from main branch.
- GIve the project an additional custom environment called "staging".
- Set the environment variable for each environment
NEXT_PUBLIC_ORY_SDK_URLas any value. - The login flow will work for production environment but fail for staging environment, with users being directed to
xyz.vercel.appwhen they initiate a login sequence
Relevant log output
Relevant configuration
Version
1.0.0-rc.0
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
No response
- 主要言語
- TypeScript
- スター
- 188
- フォーク
- 80
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ory/elements のほかの issue
-
Needs Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Needs Triage
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
good first issue help wanted upstream
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
good first issue help wanted upstream
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
似ている issue
-
bug require-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
expressjs/expressjs.com#2549 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
umami-software/umami#4686 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --display対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
pingdotgg/t3code#24900 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
inu-appcenter/UNIDorm-web#411 ·
メンテナーはふだん 1 日以内に返信
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信