-
Notifications
You must be signed in to change notification settings - Fork 485
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
SDK Spec: Backend-only #1394
SDK Spec: Backend-only #1394
Conversation
Hey, here’s your docs preview: https://clerk.com/docs/pr/1394 |
|
||
const hasPermission = (context, next) => { | ||
const auth = getAuth(context) | ||
if (!auth.has({ permission: 'permission' })) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that what you meant by hasPermission
? the has({ permission })
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for asking, I made some changes and hopefully clarified some things!
Essentially I described https://clerk.com/docs/references/nextjs/auth-object and its has()
. It's not unique to Next.js (so maybe in the wrong place?) and for now I linked to it.
Let me know if the updated text makes more sense
Co-authored-by: Alexis Aguilar <[email protected]>
docs/references/sdk/backend-only.mdx
Outdated
|
||
### Add handshake support | ||
|
||
Add checks for the `headers` to apply them from the request to the response and handle and redirect headers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is hard to grapple with if you don't have any understanding of what handshake is, or why you would need to do something like this. We could file it as a todo, as I'm not sure that writing an explanation of handshake for the docs is in scope for this PR, but this section is effectively just confusing for anyone who would realistically be trying to do anything with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, correct 👍
I also noticed this knowledge gap but decided against working on it for this PR. In the internal Notion doc I mentioned that we probably should bring #577 over the finish line and add any new info we have on handshake (that was written internally in the meantime).
Co-authored-by: Jeff Escalante <[email protected]>
Co-authored-by: Alexis Aguilar <[email protected]> Co-authored-by: Jeff Escalante <[email protected]>
Important
🔎 Previews:
This PR will be merged into #1344 and operates in the same context of "SDK Spec". Companion to #1368
Fixes ECO-110
Fixes ECO-100