diff --git a/src/main/apiClient.ts b/src/main/apiClient.ts index 568400f3..aaae73a2 100644 --- a/src/main/apiClient.ts +++ b/src/main/apiClient.ts @@ -15,7 +15,13 @@ import { popupSize } from './providerPopupSize' import { createHttpClient, HttpClient } from './httpClient' import { computePkceParams, PkceParams } from './pkceService' -export type SignupParams = { data: SignupProfile; saveCredentials?: boolean; auth?: AuthOptions; redirectUrl?: string } +export type SignupParams = { + data: SignupProfile + returnToAfterEmailConfirmation?: string + saveCredentials?: boolean + auth?: AuthOptions + redirectUrl?: string +} export type UpdateEmailParams = { accessToken: string; email: string; redirectUrl?: string } type LoginWithPasswordOptions = { password: string; saveCredentials?: boolean; auth?: AuthOptions } @@ -29,7 +35,12 @@ export type LoginWithCredentialsParams = { auth?: AuthOptions } -type EmailRequestPasswordResetParams = { email: string; redirectUrl?: string } +type EmailRequestPasswordResetParams = { + email: string + redirectUrl?: string + loginLink?: string + returnToAfterPasswordReset?: string +} type SmsRequestPasswordResetParams = { phoneNumber: string } export type RequestPasswordResetParams = EmailRequestPasswordResetParams | SmsRequestPasswordResetParams @@ -413,7 +424,7 @@ export default class ApiClient { } signup(params: SignupParams): Promise { - const { data, auth, redirectUrl } = params + const { data, auth, redirectUrl, returnToAfterEmailConfirmation } = params const acceptTos = auth && auth.acceptTos const signupPromise = window.cordova @@ -424,7 +435,8 @@ export default class ApiClient { redirectUrl, scope: this.resolveScope(auth), ...pick(auth, 'origin'), - data + data, + returnToAfterEmailConfirmation, } }) .then(result => this.eventManager.fireEvent('authenticated', result)) @@ -435,7 +447,8 @@ export default class ApiClient { redirectUrl, scope: this.resolveScope(auth), acceptTos, - data + data, + returnToAfterEmailConfirmation, } }) .then(({ tkn }) => this.loginWithPasswordToken(tkn, auth))