diff --git a/src/http.ts b/src/http.ts index a82a8b6a..d0393548 100644 --- a/src/http.ts +++ b/src/http.ts @@ -143,7 +143,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse"; import { HidePost } from "./types/HidePost"; import { ListMedia } from "./types/ListMedia"; import { ListMediaResponse } from "./types/ListMediaResponse"; -import { OAuth } from "./types/OAuth"; +import { AuthenticateWithOauth } from "./types/AuthenticateWithOauth"; enum HttpType { Get = "GET", @@ -1466,14 +1466,14 @@ export class LemmyHttp { } /** - * Register user with OAuth + * Authenticate with OAuth * - * `HTTP.Post /oauth/register` + * `HTTP.Post /oauth/authenticate` */ - registerWithOAuth(form: OAuth) { - return this.#wrapper( + authenticateWithOAuth(form: AuthenticateWithOauth) { + return this.#wrapper( HttpType.Post, - "/oauth/register", + "/oauth/authenticate", form, ); } diff --git a/src/index.ts b/src/index.ts index 7d7123dd..4489d472 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ export { AdminPurgePersonView } from "./types/AdminPurgePersonView"; export { AdminPurgePost } from "./types/AdminPurgePost"; export { AdminPurgePostView } from "./types/AdminPurgePostView"; export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; +export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth"; export { BanFromCommunity } from "./types/BanFromCommunity"; export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse"; export { BanPerson } from "./types/BanPerson"; @@ -183,7 +184,6 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView"; export { ModlogActionType } from "./types/ModlogActionType"; export { ModlogListParams } from "./types/ModlogListParams"; export { MyUserInfo } from "./types/MyUserInfo"; -export { OAuth } from "./types/OAuth"; export { OAuthAccount } from "./types/OAuthAccount"; export { OAuthAccountId } from "./types/OAuthAccountId"; export { OAuthProvider } from "./types/OAuthProvider"; @@ -196,7 +196,6 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; export { PasswordReset } from "./types/PasswordReset"; export { Person } from "./types/Person"; export { PersonAggregates } from "./types/PersonAggregates"; -export { PersonBlockId } from "./types/PersonBlockId"; export { PersonBlockView } from "./types/PersonBlockView"; export { PersonId } from "./types/PersonId"; export { PersonMention } from "./types/PersonMention"; diff --git a/src/types/OAuth.ts b/src/types/AuthenticateWithOauth.ts similarity index 70% rename from src/types/OAuth.ts rename to src/types/AuthenticateWithOauth.ts index b979548e..ca151e43 100644 --- a/src/types/OAuth.ts +++ b/src/types/AuthenticateWithOauth.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface OAuth { +export interface AuthenticateWithOauth { code: string; oauth_provider_id: string; - redirect_uri?: string; + redirect_uri: string; } diff --git a/src/types/GetSiteResponse.ts b/src/types/GetSiteResponse.ts index 415eb7a3..b042180d 100644 --- a/src/types/GetSiteResponse.ts +++ b/src/types/GetSiteResponse.ts @@ -18,6 +18,6 @@ export interface GetSiteResponse { discussion_languages: Array; taglines: Array; custom_emojis: Array; - oauth_providers: Array; + oauth_providers: Array; blocked_urls: Array; } diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index a744789a..beae140f 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -44,6 +44,7 @@ export type LemmyErrorType = | { error: "couldnt_find_comment_reply" } | { error: "couldnt_find_private_message" } | { error: "couldnt_find_activity" } + | { error: "couldnt_find_oauth_provider" } | { error: "person_is_blocked" } | { error: "community_is_blocked" } | { error: "instance_is_blocked" } diff --git a/src/types/PersonBlockId.ts b/src/types/PersonBlockId.ts deleted file mode 100644 index 7e41573b..00000000 --- a/src/types/PersonBlockId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type PersonBlockId = number;