-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(types,nextjs,clerk-react,backend): Rename Gate to Protect
- Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. - Protect can now be used without required props. In this chae behaves as `<SignedIn>` if no authorization props are passed. - `has` will throw an error if neither `permission` or `role` is passed.
- Loading branch information
1 parent
6a62af6
commit 91bf440
Showing
10 changed files
with
148 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { ClerkProvider } from './client-boundary/ClerkProvider'; | ||
export { SignedIn, SignedOut, Experimental__Gate } from './client-boundary/controlComponents'; | ||
export { SignedIn, SignedOut, Protect } from './client-boundary/controlComponents'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { ClerkProvider } from './app-router/server/ClerkProvider'; | ||
import { experimental__Gate, SignedIn, SignedOut } from './app-router/server/controlComponents'; | ||
import { Protect, SignedIn, SignedOut } from './app-router/server/controlComponents'; | ||
|
||
export { ClerkProvider, SignedOut, SignedIn, experimental__Gate as Experimental__Gate }; | ||
export { ClerkProvider, SignedOut, SignedIn, Protect }; | ||
|
||
export type ServerComponentsServerModuleTypes = { | ||
ClerkProvider: typeof ClerkProvider; | ||
SignedIn: typeof SignedIn; | ||
SignedOut: typeof SignedOut; | ||
Experimental__Gate: typeof experimental__Gate; | ||
Protect: typeof Protect; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.