Skip to content

Conversation

@dstaley
Copy link
Member

@dstaley dstaley commented Aug 5, 2024

Description

This PR adds support for ?redirect_url in Elements to both sign in and sign up.

Testing Instructions

  • While running theme builder, navigate to http://localhost:3000/sign-in?redirect_url=/404
  • Sign in
  • Confirm that you're navigated to http://localhost:3000/404?redirect_url=%2F404
  • Repeat steps for Sign Up

Notes

It really feels like this behavior should be delegated to clerk-js, possibly in the form of updating buildAfterSignInUrl to take in parameters such as redirect_url. Currently buildAfterSignInUrl only captures parameters when Clerk is initialized, not at the time of authentication.

Fixes SDKI-295

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Aug 5, 2024

🦋 Changeset detected

Latest commit: 285fce1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dstaley dstaley marked this pull request as ready for review August 6, 2024 17:15
@dstaley dstaley merged commit bbbd08b into main Aug 6, 2024
@dstaley dstaley deleted the ds.feat/elements-redirect-url branch August 6, 2024 21:31
@Adrastopoulos
Copy link

This doesn't work with absolute URLs, only relative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants