Skip to content

Commit c721028

Browse files
committed
inline comments for oauth2
1 parent d64a32d commit c721028

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/OAuth2User.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,31 @@ export type OAuth2Scopes =
2727
| "bookmark.write";
2828

2929
export interface OAuth2UserOptions {
30+
/** Can be found in the developer portal under the header "Client ID". */
3031
client_id: string;
32+
/** If you have selected an App type that is a confidential client you will be provided with a “Client Secret” under “Client ID” in your App’s keys and tokens section. */
3133
client_secret?: string;
34+
/**Your callback URL. This value must correspond to one of the Callback URLs defined in your App’s settings. For OAuth 2.0, you will need to have exact match validation for your callback URL. */
3235
callback: string;
36+
/** Scopes allow you to set granular access for your App so that your App only has the permissions that it needs. To learn more about what scopes map to what endpoints, view our {@link https://developer.twitter.com/en/docs/authentication/guides/v2-authentication-mapping authentication mapping guide}. */
3337
scopes: OAuth2Scopes[];
38+
/** Overwrite request options for all endpoints */
3439
request_options?: Partial<RequestOptions>;
3540
}
3641

3742
export type GenerateAuthUrlOptions =
3843
| {
44+
/** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */
3945
state: string;
46+
/** Specifies the method you are using to make a request (S256 OR plain). */
4047
code_challenge_method: "s256";
4148
}
4249
| {
50+
/** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */
4351
state: string;
52+
/** A PKCE parameter, a random secret for each request you make. */
4453
code_challenge: string;
54+
/** Specifies the method you are using to make a request (S256 OR plain). */
4555
code_challenge_method?: "plain";
4656
};
4757

@@ -69,9 +79,6 @@ interface RevokeAccessTokenResponse {
6979

7080
/**
7181
* Twitter OAuth2 Authentication Client
72-
*
73-
* TypeScript Authentication Client for use with the Twitter API OAuth2
74-
*
7582
*/
7683
export class OAuth2User implements AuthClient {
7784
#access_token?: string;

0 commit comments

Comments
 (0)