revokeOAuthGrant()
Revokes an OAuth grant for a specific client.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function revokeOAuthGrant( oauthAppSlug: string, oauthClientId: string, grantId: string,) { const client = await wachtClient(); await client.oauth.revokeOAuthGrant(oauthAppSlug, oauthClientId, grantId);}Signature
function revokeOAuthGrant( oauthAppSlug: string, oauthClientId: string, grantId: string,): Promise<void>Parameters
›oauthAppSlug?: string | undefined;
oauthAppSlug?: string | undefined;Parent OAuth app slug.
›oauthClientId?: string | undefined;
oauthClientId?: string | undefined;OAuth client id that owns the grant.
›grantId?: string | undefined;
grantId?: string | undefined;OAuth grant id to revoke.
Behavior
- Revokes the specified grant under the provided app and client scope.
- This method returns no payload on success.
Operational usage
- Use after
listOAuthGrants()when you need to remove a single subject grant. - Use idempotent caller logic when handling repeated revoke attempts.