Closed antonovvk closed 5 years ago
Hi @antonovvk, thanks for reporting this. Just trying to understand exactly what's going on.
Are you saying that confirm.AfterRegister() gets called, which then calls ctx.SaveUser but the User has the plaintext password inside him at that point?
Hi @aarondl, yes, register module uses AttributesFromRequest() at register.go:113
attr, err := authboss.AttributesFromRequest(r) // Attributes from overriden forms
to get forms values, and automatically sets 'confirm_password' field (with the plaintext password from the confirm form input) to the attrs (which is user). Which is later passed to confirm, and is saved to DB with SaveUser().
Should be fixed in v1.2.1. I've also added a full deprecation notice for v1 and it should no longer be used as outlined in the upgrade plan to v2 in the README. Thanks for the report and the useful test.
Thank you! Will be migrating to v2 then, and switch to v1.2.1 until migration is done.
Hi! If v1 is still used by anyone, this requires fixing. Here's the diff which reproduces it in tests: