Merge dev into update-oauth-docs

This commit is contained in:
Konsti Wohlwend 2025-09-17 04:31:11 -07:00 committed by GitHub
commit 7b4e49dc28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -1597,7 +1597,7 @@ export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, Projec
return res;
}
async signInWithOAuth(provider: ProviderType) {
async signInWithOAuth(provider: ProviderType, options?: { returnTo?: string }) {
if (typeof window === "undefined") {
throw new Error("signInWithOAuth can currently only be called in a browser environment");
}
@ -1608,7 +1608,7 @@ export class _StackClientAppImplIncomplete<HasTokenStore extends boolean, Projec
this._interface,
{
provider,
redirectUrl: this.urls.oauthCallback,
redirectUrl: options?.returnTo ?? this.urls.oauthCallback,
errorRedirectUrl: this.urls.error,
providerScope: this._oauthScopesOnSignIn[provider]?.join(" "),
},

View File

@ -38,7 +38,7 @@ export type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId ex
readonly urls: Readonly<HandlerUrls>,
signInWithOAuth(provider: string): Promise<void>,
signInWithOAuth(provider: string, options?: { returnTo?: string }): Promise<void>,
signInWithCredential(options: { email: string, password: string, noRedirect?: boolean }): Promise<Result<undefined, KnownErrors["EmailPasswordMismatch"] | KnownErrors["InvalidTotpCode"]>>,
signUpWithCredential(options: { email: string, password: string, noRedirect?: boolean, verificationCallbackUrl?: string }): Promise<Result<undefined, KnownErrors["UserWithEmailAlreadyExists"] | KnownErrors["PasswordRequirementsNotMet"]>>,
signInWithPasskey(): Promise<Result<undefined, KnownErrors["PasskeyAuthenticationFailed"]| KnownErrors["InvalidTotpCode"] | KnownErrors["PasskeyWebAuthnError"]>>,