zopefoundation / Products.PluggableAuthService

Pluggable Zope authentication / authorization framework
Other
9 stars 18 forks source link

ICredentialsUpdatedEvent event handler incorrectly calls updateCredentials #59

Closed ericof closed 4 years ago

ericof commented 4 years ago

Products.PluggableAuthService.events.userCredentialsUpdatedHandler calls updateCredentials explicitly passing the principal object.

@adapter(IBasicUser, ICredentialsUpdatedEvent)
def userCredentialsUpdatedHandler(principal, event):
    pas = aq_parent(principal)
    pas.updateCredentials(
            pas,
            pas.REQUEST,
            pas.REQUEST.RESPONSE,
            principal.getId(),
            event.password)

As pas in here is an instance, updateCredentials already receives self implicitly -- no need to provide it.