Skip to content

Commit

Permalink
fix(analytics): enter password tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Sep 1, 2021
1 parent e6e3493 commit ab414fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const NEED_HELP_CLICKED = 'NEED_HELP_CLICKED'
export const LOGIN_ID_ENTERED = 'LOGIN_ID_ENTERED'
export const LOGIN_METHOD_SELECTED = 'LOGIN_METHOD_SELECTED'
export const LOGIN_PASSWORD_DENIED = 'LOGIN_PASSWORD_DENIED'
export const LOGIN_PASSWORD_ENTERED = 'LOGIN_PASSWORD_ENTERED'
export const LOGIN_TWO_STEP_VERIFICATION_DENIED = 'LOGIN_TWO_STEP_VERIFICATION_DENIED'
export const LOGIN_TWO_STEP_VERIFICATION_ENTERED = 'LOGIN_TWO_STEP_VERIFICATION_ENTERED'
export const RECOVERY_OPTION_SELECTED = 'RECOVERY_OPTION_SELECTED'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ export const loginPasswordDenied = () => ({
type: AT.LOGIN_PASSWORD_DENIED
})

export const loginPasswordEntered = () => ({
type: AT.LOGIN_PASSWORD_ENTERED
})

export const loginTwoStepVerificationDenied = () => ({
type: AT.LOGIN_TWO_STEP_VERIFICATION_DENIED
})
Expand Down
4 changes: 4 additions & 0 deletions packages/blockchain-wallet-v4-frontend/src/data/auth/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,13 @@ export default ({ api, coreSagas, networks }) => {
const formValues = yield select(selectors.form.getFormValues('login'))
const { email, emailToken } = formValues
let session = yield select(selectors.session.getSession, guid, email)
// JUST FOR ANALYTICS PURPOSES
if (code) {
yield put(A.loginTwoStepVerificationEntered())
} else {
yield put(A.loginPasswordEntered())
}
// JUST FOR ANALYTICS PURPOSES
yield put(startSubmit('login'))
try {
if (!session) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2846,7 +2846,7 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
})
break
}
case AT.auth.LOGIN: {
case AT.auth.LOGIN_PASSWORD_ENTERED: {
const state = store.getState()
const nabuId = state.profile.userData.getOrElse({})?.id ?? null
const email = state.profile.userData.getOrElse({})?.emailVerified
Expand Down Expand Up @@ -3050,8 +3050,7 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
})
break
}
// TODO STILL NEED TO FIGURE OUT SPECIFICS FOR THIS EVENT
case AT.auth.RESTORE: {
case AT.auth.RESTORE_FROM_METADATA: {
const state = store.getState()
const nabuId = state.profile.userData.getOrElse({})?.id ?? null
const email = state.profile.userData.getOrElse({})?.emailVerified
Expand Down

0 comments on commit ab414fb

Please sign in to comment.