diff --git a/v8/rest/index.ts b/v8/rest/index.ts index 0a7f36bb..75ffb56a 100644 --- a/v8/rest/index.ts +++ b/v8/rest/index.ts @@ -564,6 +564,14 @@ export const Routes = { return `/oauth2/applications/@me`; }, + /** + * Route for: + * - GET `/oauth2/@me` + */ + oauth2CurrentAuthorization() { + return `/oauth2/@me`; + }, + /** * Route for: * - GET `/applications/{application.id}/commands` diff --git a/v8/rest/oauth2.ts b/v8/rest/oauth2.ts index 0eeb6869..3541ad35 100644 --- a/v8/rest/oauth2.ts +++ b/v8/rest/oauth2.ts @@ -1,11 +1,33 @@ import type { Permissions, Snowflake } from '../../common/index'; -import type { APIApplication, APIGuild, APIWebhook, OAuth2Scopes } from '../payloads/index'; +import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads/index'; /** * https://discord.com/developers/docs/topics/oauth2#get-current-application-information */ export type RESTGetAPIOauth2CurrentApplicationResult = Omit; +/** + * https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information + */ +export interface RESTGetAPIOauth2CurrentAuthorizationResult { + /** + * the current application + */ + application: Partial; + /** + * the scopes the user has authorized the application for + */ + scopes: OAuth2Scopes[]; + /** + * when the access token expires + */ + expires: string; + /** + * the user who has authorized, if the user has authorized with the `identify` scope + */ + user?: APIUser; +} + /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant */