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(remix): Support new redirect urls as environment variables or options to rootAuthLoader #3442

Merged

Conversation

panteliselef
Copy link
Member

Description

As options

  • signInForceRedirectUrl
  • signUpForceRedirectUrl
  • signInFallbackRedirectUrl
  • signUpFallbackRedirectUrl

As environment variables

  • CLERK_SIGN_IN_FORCE_REDIRECT_URL
  • CLERK_SIGN_UP_FORCE_REDIRECT_URL
  • CLERK_SIGN_IN_FALLBACK_REDIRECT_URL
  • CLERK_SIGN_UP_FALLBACK_REDIRECT_URL

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:

…tions to rootAuthLoader

As options
- signInForceRedirectUrl
- signUpForceRedirectUrl
- signInFallbackRedirectUrl
- signUpFallbackRedirectUrl

As environment variables
- CLERK_SIGN_IN_FORCE_REDIRECT_URL
- CLERK_SIGN_UP_FORCE_REDIRECT_URL
- CLERK_SIGN_IN_FALLBACK_REDIRECT_URL
- CLERK_SIGN_UP_FALLBACK_REDIRECT_URL
@panteliselef panteliselef self-assigned this May 24, 2024
Copy link

changeset-bot bot commented May 24, 2024

🦋 Changeset detected

Latest commit: 5753a31

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

This PR includes changesets to release 1 package
Name Type
@clerk/remix Minor

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

Comment on lines 52 to 53
const _requestState = await authenticateRequest(args, loadedOptions);
const requestState = { ...loadedOptions, ..._requestState };
Copy link
Member Author

@panteliselef panteliselef May 24, 2024

Choose a reason for hiding this comment

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

❓Should @clerk/backend be aware of these new redirect urls ? Seems like afterXUrl are being returned as part of the SignedIn/OutState

Copy link
Contributor

@dimkl dimkl May 29, 2024

Choose a reason for hiding this comment

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

❓ Aren't those properties only available in the client? I believe that the only reason the afterXUrl exist in the backend is for debugging.
@nikosdouvlis Do you have more context?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, i would expect them to only be used in the client as well.
Do you think we should update add the new urls in the request state for usage in debugging as well ? Or is it ok to leave the PR as it is now ?

Copy link
Member

Choose a reason for hiding this comment

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

Why wouldn't we want them in loadedOptions? I think we can safely add them - improved debuggability is a welcome side effect

@@ -80,6 +84,10 @@ export function ClerkProvider({ children, ...rest }: ClerkProviderPropsWithState
signUpUrl: __signUpUrl,
afterSignInUrl: __afterSignInUrl,
afterSignUpUrl: __afterSignUpUrl,
Copy link
Member

Choose a reason for hiding this comment

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

❓ Do we still need these or can we mark them as deprecated?

Comment on lines 52 to 53
const _requestState = await authenticateRequest(args, loadedOptions);
const requestState = { ...loadedOptions, ..._requestState };
Copy link
Member

Choose a reason for hiding this comment

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

Why wouldn't we want them in loadedOptions? I think we can safely add them - improved debuggability is a welcome side effect

@nikosdouvlis nikosdouvlis merged commit 6af51c8 into main Jun 5, 2024
3 checks passed
@nikosdouvlis nikosdouvlis deleted the elef/sdk-1719-support-the-new-redirect-url-envs-in-remix branch June 5, 2024 11:03
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.

5 participants