-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…2329) * feat(nextjs): Accept `redirectUrl` as option for `auth().protect()` * feat(nextjs): Allow for redirectUrl to be the first parameter * Revert "feat(nextjs): Allow for redirectUrl to be the first parameter" This reverts commit ee5708a. * chore(nextjs): Update changeset * Revert "Revert "feat(nextjs): Allow for redirectUrl to be the first parameter"" This reverts commit 2b0f942.
- Loading branch information
1 parent
1b4eff9
commit 05bda49
Showing
2 changed files
with
53 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
'@clerk/nextjs': patch | ||
--- | ||
|
||
Accept `redirectUrl` as an option for `auth().protect()`. | ||
|
||
For example: | ||
|
||
```ts | ||
// Authorization | ||
auth().protect({ role:'org:admin' }, { redirectUrl: "/any-page" }) | ||
auth().protect({ permission:'org:settings:manage' }, { redirectUrl: "/any-page" }) | ||
|
||
// Authentication | ||
auth().protect({ redirectUrl: "/any-page" }) | ||
``` |
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