-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add token.revoke to OAuth client
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
import { type HttpMetaParams } from "../../interfaces"; | ||
import { type TokenRepository } from "./token-repository"; | ||
|
||
export interface RevokeTokenParams { | ||
/** The client ID, obtained during app registration. */ | ||
readonly clientId: string; | ||
/** The client secret, obtained during app registration. */ | ||
readonly clientSecret: string; | ||
/** The previously obtained token, to be invalidated. */ | ||
readonly token: string; | ||
} | ||
|
||
export interface Client { | ||
readonly token: TokenRepository; | ||
|
||
/** | ||
* Revoke an access token to make it no longer valid for use. | ||
* @param params Form data parameters | ||
* @param meta HTTP metadata | ||
* @see https://docs.joinmastodon.org/methods/oauth/#revoke | ||
*/ | ||
revoke( | ||
params: RevokeTokenParams, | ||
meta?: HttpMetaParams<"multipart-form">, | ||
): Promise<void>; | ||
} |
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