From 477bbc28590b165228d68b02e5e3628a14a5f079 Mon Sep 17 00:00:00 2001 From: Mihaly Lengyel Date: Fri, 18 Oct 2024 11:08:33 +0200 Subject: [PATCH] fix: add missing types to OAuth2Provider recipe init --- lib/build/recipe/oauth2provider/index.d.ts | 9 ++++++++- lib/build/recipe/oauth2provider/recipe.d.ts | 4 +++- lib/ts/recipe/oauth2provider/index.ts | 1 + lib/ts/recipe/oauth2provider/recipe.ts | 4 +++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/build/recipe/oauth2provider/index.d.ts b/lib/build/recipe/oauth2provider/index.d.ts index 1a574d79b..1a532d9f0 100644 --- a/lib/build/recipe/oauth2provider/index.d.ts +++ b/lib/build/recipe/oauth2provider/index.d.ts @@ -4,7 +4,14 @@ import { UserInput, GetRedirectionURLContext, PreAPIHookContext, OnHandleEventCo import type { RecipeFunctionOptions, LoginInfo } from "supertokens-web-js/recipe/oauth2provider"; import type { RecipeInterface } from "supertokens-web-js/recipe/oauth2provider"; export default class Wrapper { - static init(config?: UserInput): import("../../types").RecipeInitResult; + static init( + config?: UserInput + ): import("../../types").RecipeInitResult< + GetRedirectionURLContext, + import("./types").PreAndPostAPIHookAction, + OnHandleEventContext, + import("./types").NormalisedConfig + >; /** * Returns information about an OAuth login in progress * diff --git a/lib/build/recipe/oauth2provider/recipe.d.ts b/lib/build/recipe/oauth2provider/recipe.d.ts index 88f243b82..480be9d0e 100644 --- a/lib/build/recipe/oauth2provider/recipe.d.ts +++ b/lib/build/recipe/oauth2provider/recipe.d.ts @@ -22,7 +22,9 @@ export default class OAuth2Provider extends RecipeModule< config: NormalisedConfigWithAppInfoAndRecipeID, webJSRecipe?: WebJSRecipeInterface ); - static init(config?: UserInput): RecipeInitResult; + static init( + config?: UserInput + ): RecipeInitResult; static getInstanceOrThrow(): OAuth2Provider; static getInstance(): OAuth2Provider | undefined; getDefaultRedirectionURL(ctx: GetRedirectionURLContext): Promise; diff --git a/lib/ts/recipe/oauth2provider/index.ts b/lib/ts/recipe/oauth2provider/index.ts index b935f352f..609b04d26 100644 --- a/lib/ts/recipe/oauth2provider/index.ts +++ b/lib/ts/recipe/oauth2provider/index.ts @@ -24,6 +24,7 @@ export default class Wrapper { static init(config?: UserInput) { return OAuth2Provider.init(config); } + /** * Returns information about an OAuth login in progress * diff --git a/lib/ts/recipe/oauth2provider/recipe.ts b/lib/ts/recipe/oauth2provider/recipe.ts index 1509a632d..fd371b9e3 100644 --- a/lib/ts/recipe/oauth2provider/recipe.ts +++ b/lib/ts/recipe/oauth2provider/recipe.ts @@ -57,7 +57,9 @@ export default class OAuth2Provider extends RecipeModule< super(config); } - static init(config?: UserInput): RecipeInitResult { + static init( + config?: UserInput + ): RecipeInitResult { const normalisedConfig = normaliseOAuth2Config(config); return { recipeID: OAuth2Provider.RECIPE_ID,