Skip to content

Commit

Permalink
fix: Force password change error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Mar 1, 2024
1 parent e2f8cea commit dd0516d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/ui/user-auth-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
setError(e.message)
}

if (e.response.data.new_password) {
setError(
e.response.data.new_password[1] ||
e.response.data.new_password[0] ||
e.response.data.new_password
)
}

if (e.response.status === 405) {
setForceChange(true)
}
Expand Down

0 comments on commit dd0516d

Please sign in to comment.