clerk / javascript

Official Javascript repository for Clerk authentication
https://clerk.com
MIT License
1.12k stars 246 forks source link

feat(clerk-js,clerk-react,types,nextjs): Support assurance in `has()` #4118

Closed panteliselef closed 1 month ago

panteliselef commented 1 month ago

Description

This PR adds experimental support for has() with assurance.

has({ 
  __experimental_assurance: {
    level: 'L2.secondFactor',
    maxAge: 'A1.10min'
  }
})

Also I introduced a new shared utility called createCheckAuthorization exported from @clerk/shared that all other packages can use.

Checklist

Type of change

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: b3c280e2910c563341480f789b1cfb91bf780c5c

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

This PR includes changesets to release 18 packages | Name | Type | | ----------------------- | ----- | | @clerk/clerk-js | Minor | | @clerk/backend | Minor | | @clerk/shared | Minor | | @clerk/clerk-react | Minor | | @clerk/types | Minor | | @clerk/chrome-extension | Patch | | @clerk/clerk-expo | Patch | | @clerk/astro | Patch | | @clerk/express | Patch | | @clerk/fastify | Patch | | @clerk/nextjs | Patch | | @clerk/remix | Patch | | @clerk/clerk-sdk-node | Patch | | @clerk/tanstack-start | Patch | | @clerk/testing | Patch | | @clerk/elements | Patch | | @clerk/localizations | Patch | | @clerk/themes | 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](https://github.com/clerk/javascript/new/elef/user-608-update-any-has-utility-to-support-assurance?filename=.changeset/odd-oranges-tell.md&value=---%0A%22%40clerk%2Fbackend%22%3A%20patch%0A%22%40clerk%2Fclerk-js%22%3A%20patch%0A%22%40clerk%2Fclerk-react%22%3A%20patch%0A%22%40clerk%2Fshared%22%3A%20patch%0A%22%40clerk%2Ftypes%22%3A%20patch%0A---%0A%0Afeat(clerk-js%2Cclerk-react%2Ctypes%2Cnextjs)%3A%20Support%20assurance%20in%20%60has()%60%0A)