two-factor icon indicating copy to clipboard operation
two-factor copied to clipboard

Error Reporting from Saving methods

Open mikeselander opened this issue 6 years ago • 1 comments

As the save methods are currently architected, errors are not returned and are therefore unusable outside of the normal save method. It would be useful to have a way of retrieving these errors for use outside of this default setup.

For example, when working on the force-2fa functionality I have a standalone takeover view that uses AJAX to submit the settings and re-load to a normal view once submitted. the problem is that I have no useful information coming back from the save methods so I have to re-load the page whether saving was successful or not which is very confusing from a user's perspective.

mikeselander avatar Sep 05 '18 17:09 mikeselander

I ran into this myself while integrating the two-factor plugin outside the admin area. I had to use the 'updated_user_meta' hook to see which user meta key was being saved to make some determinations based on that.

Should be tied to the following issue: #335.

r-a-y avatar Oct 29 '20 23:10 r-a-y