Skip to content

Commit

Permalink
docs: update tsdocs for signInAnonymously (#866)
Browse files Browse the repository at this point in the history
## What kind of change does this PR introduce?
* Add tsdocs to the `signInAnonymously` method
  • Loading branch information
kangmingtay authored Mar 19, 2024
1 parent 860bffc commit 9a02980
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthResponse> {
try {
await this._removeSession()
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9a02980

Please sign in to comment.