diff --git a/src/components/AuthenticationFlow/EmailLoginForm.tsx b/src/components/AuthenticationFlow/EmailLoginForm.tsx index f9f54ef78..8e7e2c0a3 100644 --- a/src/components/AuthenticationFlow/EmailLoginForm.tsx +++ b/src/components/AuthenticationFlow/EmailLoginForm.tsx @@ -1,8 +1,10 @@ -import Cookies from 'js-cookie'; import type { FormEvent } from 'react'; import { useId, useState } from 'react'; import { httpPost } from '../../lib/http'; -import { FIRST_LOGIN_PARAM, setAuthToken } from '../../lib/jwt'; +import { + COURSE_PURCHASE_PARAM, FIRST_LOGIN_PARAM, + setAuthToken +} from '../../lib/jwt'; type EmailLoginFormProps = { isDisabled?: boolean; @@ -38,7 +40,10 @@ export function EmailLoginForm(props: EmailLoginFormProps) { const currentLocation = window.location.href; const url = new URL(currentLocation, window.location.origin); + url.searchParams.set(FIRST_LOGIN_PARAM, response?.isNewUser ? '1' : '0'); + url.searchParams.set(COURSE_PURCHASE_PARAM, '1'); + window.location.href = url.toString(); return; } @@ -90,7 +95,7 @@ export function EmailLoginForm(props: EmailLoginFormProps) { onInput={(e) => setPassword(String((e.target as any).value))} /> -

+