MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / throwOnMissingOAuthScope

Function throwOnMissingOAuthScope

server/utils/atproto/oauth.ts:135–143  ·  view source on GitHub ↗
(oAuthSession: OAuthSession, requiredScopes: string)

Source from the content-addressed store, hash-verified

133 * @param requiredScopes - The required scope you are checking if you can use
134 */
135export async function throwOnMissingOAuthScope(oAuthSession: OAuthSession, requiredScopes: string) {
136 const tokenInfo = await oAuthSession.getTokenInfo()
137 if (!tokenInfo.scope.includes(requiredScopes)) {
138 throw createError({
139 status: 403,
140 message: ERROR_NEED_REAUTH,
141 })
142 }
143}
144
145export function eventHandlerWithOAuthSession<T extends EventHandlerRequest, D>(
146 handler: EventHandlerWithOAuthSession<T, D>,

Callers 3

like.post.tsFile · 0.90
like.delete.tsFile · 0.90
index.put.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected