Skip to content

Commit

Permalink
moved forgotYourPassword into AuthModel
Browse files Browse the repository at this point in the history
  • Loading branch information
iskounen committed Oct 21, 2024
1 parent 4d37259 commit 89d15d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
11 changes: 0 additions & 11 deletions src/app/Scenes/Onboarding/Auth2/scenes/ForgotPasswordStep.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ActionType, ResetYourPassword } from "@artsy/cohesion"
import { BackButton, Button, Flex, Input, Spacer, Text, useTheme } from "@artsy/palette-mobile"
import {
useAuthNavigation,
Expand All @@ -8,7 +7,6 @@ import { useInputAutofocus } from "app/Scenes/Onboarding/Auth2/hooks/useInputAut
import { GlobalStore } from "app/store/GlobalStore"
import { Formik, useFormikContext } from "formik"
import { useEffect, useRef } from "react"
import { useTracking } from "react-tracking"
import * as Yup from "yup"

interface ForgotPasswordStepFormValues {
Expand All @@ -18,7 +16,6 @@ interface ForgotPasswordStepFormValues {
export const ForgotPasswordStep: React.FC = () => {
const navigation = useAuthNavigation()
const screen = useAuthScreen()
const tracking = useTracking()

return (
<Formik<ForgotPasswordStepFormValues>
Expand All @@ -34,7 +31,6 @@ export const ForgotPasswordStep: React.FC = () => {
"Couldn't send reset password link. Please try again, or contact [email protected]",
})
} else {
tracking.trackEvent(tracks.resetYourPassword())
navigation.setParams({ requestedPasswordReset: true })
}
}}
Expand Down Expand Up @@ -185,10 +181,3 @@ const ForgotPasswordStepForm: React.FC = () => {
</Flex>
)
}

const tracks = {
resetYourPassword: (): Partial<ResetYourPassword> => ({
action: ActionType.resetYourPassword,
trigger: "tap",
}),
}
8 changes: 7 additions & 1 deletion src/app/store/AuthModel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActionType, AuthService, CreatedAccount } from "@artsy/cohesion"
import { ActionType, AuthService, CreatedAccount, ResetYourPassword } from "@artsy/cohesion"
import Braze from "@braze/react-native-sdk"
import { appleAuth } from "@invertase/react-native-apple-authentication"
import CookieManager from "@react-native-cookies/cookies"
Expand Down Expand Up @@ -278,6 +278,8 @@ export const getAuthModel = (): AuthModel => ({
// For security purposes we don't want to disclose when a user is not found
// this is indicated by 400 on gravity side, treat as success
if (result.ok || result.status === 400) {
postEventToProviders(tracks.resetYourPassword())

return true
}
return false
Expand Down Expand Up @@ -880,4 +882,8 @@ const tracks = {
action: ActionType.successfullyLoggedIn,
service,
}),
resetYourPassword: (): Partial<ResetYourPassword> => ({
action: ActionType.resetYourPassword,
trigger: "tap",
}),
}

0 comments on commit 89d15d6

Please sign in to comment.