From 9a0298093e98a65969e43e476f24235ff12022e4 Mon Sep 17 00:00:00 2001 From: Kang Ming Date: Tue, 19 Mar 2024 16:25:36 +0700 Subject: [PATCH] docs: update tsdocs for signInAnonymously (#866) ## What kind of change does this PR introduce? * Add tsdocs to the `signInAnonymously` method --- src/GoTrueClient.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index cd6367429..0afd4710c 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -360,6 +360,11 @@ export default class GoTrueClient { } } + /** + * Creates a new anonymous user. + * + * @returns A session where the is_anonymous claim in the access token JWT set to true + */ async signInAnonymously(credentials?: SignInAnonymouslyCredentials): Promise { try { await this._removeSession() @@ -415,7 +420,7 @@ export default class GoTrueClient { let codeChallenge: string | null = null let codeChallengeMethod: string | null = null if (this.flowType === 'pkce') { - [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( + ;[codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( this.storage, this.storageKey ) @@ -679,7 +684,7 @@ export default class GoTrueClient { let codeChallenge: string | null = null let codeChallengeMethod: string | null = null if (this.flowType === 'pkce') { - [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( + ;[codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( this.storage, this.storageKey ) @@ -797,7 +802,7 @@ export default class GoTrueClient { let codeChallenge: string | null = null let codeChallengeMethod: string | null = null if (this.flowType === 'pkce') { - [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( + ;[codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( this.storage, this.storageKey ) @@ -1243,7 +1248,7 @@ export default class GoTrueClient { let codeChallenge: string | null = null let codeChallengeMethod: string | null = null if (this.flowType === 'pkce' && attributes.email != null) { - [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( + ;[codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( this.storage, this.storageKey ) @@ -1673,7 +1678,7 @@ export default class GoTrueClient { let codeChallengeMethod: string | null = null if (this.flowType === 'pkce') { - [codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( + ;[codeChallenge, codeChallengeMethod] = await getCodeChallengeAndMethod( this.storage, this.storageKey, true // isPasswordRecovery