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

パラメータを含む動的ルートからリダイレクトしてログインした場合に想定通りの場所に遷移できない #1902

Open
KentaHizume opened this issue Jan 23, 2025 · 1 comment
Labels
not triaged 精緻化、分析がされていない

Comments

@KentaHizume
Copy link
Contributor

概要

consumerで、パラメータを含む動的ルートからリダイレクトしてログインした場合、想定通りの遷移をしません。
直接の原因は、ナビゲーションガードでリダイレクト用のnameを取得する際に、paramsが取得できていないためと思われます。

  router.push({ name: getRedirectFrom.value });
    const redirectFromPath: string = to.name?.toString() ?? '';
    routingStore.setRedirectFrom(redirectFromPath);
    return { name: 'authentication/login' };

詳細

再現方法

  • consumer を mockモードで起動します。
  • http://localhost:5173/ordering/checkout まで遷移します。
  • 開発者ツールでauthenticationStateをfalseに変更します。
  • 注文を確定します。
  • ログイン画面にリダイレクトするので、ログインします。
  • エラー画面に遷移し、コンソール に Error: Missing required param "orderId" が出力されます。
    Image

完了条件

  • パラメータを含む動的ルートからリダイレクトした場合も、ログイン後に想定通りのページへ遷移すること
@KentaHizume KentaHizume added the not triaged 精緻化、分析がされていない label Jan 23, 2025
@KentaHizume
Copy link
Contributor Author

adminはfullPathを使用しているので動くようだが、
router.push時は名前付きルートを使うほうがよいはずなので、
paramsも(おそらくqueryも)routingStoreに保持する方向で修正したほうがよいかもしれない。

router.push({ path: getRedirectFrom.value });
    const redirectFromPath: string = to.fullPath;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not triaged 精緻化、分析がされていない
Projects
None yet
Development

No branches or pull requests

1 participant