Skip to content

Feat(backend, nextjs): introduce redirectToSignIn / redirectToSignup helper - #1108

Merged
nikosdouvlis merged 6 commits into
mainfrom
js-71-backend-signup-signin-redirect
Apr 27, 2023
Merged

Feat(backend, nextjs): introduce redirectToSignIn / redirectToSignup helper#1108
nikosdouvlis merged 6 commits into
mainfrom
js-71-backend-signup-signin-redirect

Conversation

@dimkl

@dimkl dimkl commented Apr 26, 2023

Copy link
Copy Markdown
Contributor

Type of change

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

Packages affected

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

Description

  • npm test runs as expected.
  • npm run build runs as expected.

Introduced redirectToSignIn / redirectToSignup helper in @clerk/backend package and a wrapper of those in @clerk/nextjs to support a better DX for redirecting to sing-in and sign-up pages.

The new NextJS helpers are gonna work as :

  • redirect to sign-in/sign-up provided by NEXT_PUBLIC_CLERK_SIGN_{UP|IN}_URL env variables
  • redirect to hosted pages sign-in/sign-up as fallback

Some key notes:

  • redirectBackUrl is optional

Notes

Review it per commit

@dimkl
dimkl requested a review from anagstef April 26, 2023 14:29
@dimkl dimkl self-assigned this Apr 26, 2023

@jit-ci jit-ci Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆

@dimkl

dimkl commented Apr 26, 2023

Copy link
Copy Markdown
Contributor Author

Ignore the failing tests. They are related to the addition of NEXT_PUBLIC_CLERK_SIGN_UP_URL env which will be also added by another PR from Stefanos before this PR is merged.

Comment thread packages/backend/src/redirect.ts Outdated
Comment thread packages/backend/src/redirect.ts Outdated
Comment thread packages/backend/src/redirect.ts Outdated
Comment thread packages/backend/src/redirect.ts Outdated
@dimkl
dimkl force-pushed the js-71-backend-signup-signin-redirect branch 2 times, most recently from baf1590 to 8abe1a2 Compare April 27, 2023 10:08
@dimkl
dimkl force-pushed the js-71-backend-signup-signin-redirect branch from 6469ac6 to 9fec947 Compare April 27, 2023 16:18
@dimkl
dimkl force-pushed the js-71-backend-signup-signin-redirect branch from 9fec947 to ab3fcaa Compare April 27, 2023 16:29
@nikosdouvlis
nikosdouvlis merged commit dbbfe65 into main Apr 27, 2023
@nikosdouvlis
nikosdouvlis deleted the js-71-backend-signup-signin-redirect branch April 27, 2023 16:35
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants