Skip to content

Commit

Permalink
fix: Throw on password reset errors (#21007)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Mar 20, 2024
1 parent c55d501 commit f5ec54d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/scenes/authentication/passwordResetLogic.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { captureException } from '@sentry/react'
import { kea, path, reducers } from 'kea'
import { forms } from 'kea-forms'
import { loaders } from 'kea-loaders'
Expand Down Expand Up @@ -69,7 +70,9 @@ export const passwordResetLogic = kea<passwordResetLogicType>([
try {
await api.create('api/reset/', { email })
} catch (e: any) {
actions.setRequestPasswordResetManualErrors(e)
actions.setRequestPasswordResetManualErrors({ email: e.detail ?? 'An error occurred' })
captureException('Failed to reset password', { extra: { error: e } })
throw e
}
},
},
Expand Down Expand Up @@ -104,6 +107,7 @@ export const passwordResetLogic = kea<passwordResetLogicType>([
window.location.href = '/' // We need the refresh
} catch (e: any) {
actions.setPasswordResetManualErrors({ password: e.detail })
throw e
}
},
},
Expand Down

0 comments on commit f5ec54d

Please sign in to comment.