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(clerk-js,types): Drop redirectToHome in favour of redirectToAfterSignIn & redirectToAfterSignUp [SDK-875] #2251

Conversation

octoper
Copy link
Member

@octoper octoper commented Dec 4, 2023

Description

This PR introduces two breaking changes:

  • The redirectToHome method has been replaced with redirectToAfterSignIn and redirectToAfterSignUp redirect methods.
  • When the <SignIn/> and <SignUp/> components are rendered while a user is already logged in, they will now redirect to the configured afterSignIn and afterSignUp URLs respectively. Previously, the redirect URL was the home URL that was configured in the dashboard.

SDK-875

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:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

Copy link

changeset-bot bot commented Dec 4, 2023

🦋 Changeset detected

Latest commit: 03586f5

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

This PR includes changesets to release 11 packages
Name Type
@clerk/clerk-js Major
@clerk/clerk-react Major
@clerk/types Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
gatsby-plugin-clerk Patch
@clerk/nextjs Patch
@clerk/remix Patch
@clerk/backend Patch
@clerk/fastify Patch
@clerk/clerk-sdk-node 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

Copy link
Contributor

github-actions bot commented Dec 4, 2023

⚠️ Changes detected under the ClerkJS ui directory!

Don't forget to apply the same changes under the /ui.retheme directory:
packages/clerk-js/src/ui/** ➡️ packages/clerk-js/src/ui.retheme/**

Also, you may need to update the following files:

  • packages/localizations/src/en-US.retheme.ts
  • packages/localizations/src/index.retheme.ts
  • packages/types/src/appearance.retheme.ts
  • packages/types/src/clerk.retheme.ts
  • packages/types/src/index.retheme.ts
  • packages/types/src/localization.retheme.ts

@octoper octoper force-pushed the vaggelis/sdk-875-we-should-make-sure-redirecttohome-is-replaced-in-v5-with branch 6 times, most recently from 7bffb59 to 99a1541 Compare December 7, 2023 10:32
@octoper octoper force-pushed the vaggelis/sdk-875-we-should-make-sure-redirecttohome-is-replaced-in-v5-with branch 3 times, most recently from 3acd80f to 095cae7 Compare December 13, 2023 11:32
@octoper octoper marked this pull request as ready for review December 13, 2023 11:46
this.premountMethodCalls.set('buildHomeUrl', callback);
}
};

Copy link
Contributor

Choose a reason for hiding this comment

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

🔧 We should also introduce the buildAfterSignInUrl and buildAfterSignUpUrl here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@@ -1,5 +1,6 @@
import type { UserResource } from '@clerk/types';
import { describe, it } from '@jest/globals';
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Do we need this?

@octoper octoper requested a review from dimkl December 13, 2023 14:58
@octoper octoper force-pushed the vaggelis/sdk-875-we-should-make-sure-redirecttohome-is-replaced-in-v5-with branch from e519845 to 295b414 Compare December 13, 2023 15:00
@SokratisVidros SokratisVidros merged commit ab4eb56 into main Dec 13, 2023
@SokratisVidros SokratisVidros deleted the vaggelis/sdk-875-we-should-make-sure-redirecttohome-is-replaced-in-v5-with branch December 13, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants