Skip to content

Commit

Permalink
Merge pull request #780 from alexstotsky/improve-otp-login-flow
Browse files Browse the repository at this point in the history
(improvement) OTP login flow
  • Loading branch information
ezewer authored Mar 5, 2024
2 parents f905a69 + 472c3d2 commit fdf94e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/state/auth/saga.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ function* onAuthSuccess(result) {
time: formatAuthDate(new Date()),
}))

yield put(actions.disableAuthBtn(false))
yield put(actions.authSuccess(result))
yield put(actions.hideAuth())
} catch (fail) {
yield put(updateAuthErrorStatus(fail))
yield put(actions.disableAuthBtn(false))
}
}

Expand Down Expand Up @@ -127,6 +129,7 @@ function* signUp({ payload }) {
yield put(actions.updateAuthStatus())

if (error) {
yield put(actions.disableAuthBtn(false))
if (authToken) {
yield put(actions.updateAuth({ authToken: '' }))
}
Expand All @@ -145,6 +148,7 @@ function* signUp({ payload }) {
}
} catch (fail) {
yield put(updateAuthErrorStatus(fail))
yield put(actions.disableAuthBtn(false))
}
}

Expand Down Expand Up @@ -194,7 +198,6 @@ function* signUpOtp({ payload }) {
password,
isNotProtected,
}
yield put(actions.disableAuthBtn(false))
yield put(actions.signUp(authParams))
}

Expand Down

0 comments on commit fdf94e3

Please sign in to comment.