From 352c8bef936ae6135a9f9f4ab1dacf093efc87e8 Mon Sep 17 00:00:00 2001 From: aswathy-deriv Date: Wed, 21 Feb 2024 16:38:28 +0400 Subject: [PATCH] fix: added the token auth --- .../pages/signup-academy-complete/academy-input.tsx | 5 +++-- .../pages/signup-academy-complete/password-form.tsx | 8 ++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/features/pages/signup-academy-complete/academy-input.tsx b/src/features/pages/signup-academy-complete/academy-input.tsx index 612be74d3d0..32e5a87911b 100644 --- a/src/features/pages/signup-academy-complete/academy-input.tsx +++ b/src/features/pages/signup-academy-complete/academy-input.tsx @@ -22,7 +22,7 @@ export const StyledRelativeWrapper = styled(RelativeWrapper)` export const ErrorMessage = styled.div<{ is_warning?: boolean }>` position: absolute; font-size: 12px; - color: ${({ is_warning }) => (is_warning ? 'var(--color-green)' : 'var(--color-red)')}; + color: ${({ is_warning }) => (is_warning ? 'var(--color-yellow-3)' : 'var(--color-red)')}; padding: 6px 0; ` const StyledIcon = styled.img<{ password_icon?: boolean }>` @@ -48,6 +48,7 @@ export const Label = styled(StyledLabel)` export const StyledInputWrapper = styled(InputWrapper)<{ password_length?: number is_password?: boolean + // is_warning:boolean }>` border-radius: 4px; border: solid 1px var(--color-grey-7); @@ -98,7 +99,7 @@ const AcademyPasswordInput = ({ return ( diff --git a/src/features/pages/signup-academy-complete/password-form.tsx b/src/features/pages/signup-academy-complete/password-form.tsx index 3c17820937a..975570525e7 100644 --- a/src/features/pages/signup-academy-complete/password-form.tsx +++ b/src/features/pages/signup-academy-complete/password-form.tsx @@ -40,11 +40,6 @@ const AcademyPasswordForm = ({ residence }: AcademyPasswordFormProps) => { const params = new URLSearchParams(isBrowser() && location.search) const codeValue = params.get('code') - const handleNavigation = () => { - window.location.href = - 'https://oauth.deriv.com/oauth2/session/thinkific/create?app_id=37228' - } - const GetDerivAcademy = () => { apiManager .augmentedSend('new_account_virtual', { @@ -55,6 +50,7 @@ const AcademyPasswordForm = ({ residence }: AcademyPasswordFormProps) => { verification_code: codeValue, }) .then((response) => { + const auth_token = response.new_account_virtual.oauth_token console.log(response) if (response.error) { setSubmitStatus('error') @@ -62,7 +58,7 @@ const AcademyPasswordForm = ({ residence }: AcademyPasswordFormProps) => { } else { setSubmitStatus('success') //setting the session token - handleNavigation() + window.location.href = `https://oauth.deriv.com/oauth2/session/thinkific/create?app_id=37228&token1=${auth_token}` } }) }