servicestack,Authentication,servicestack" /> servicestack,Authentication,servicestack" />

Authentication 密码未更改时,ServiceStack OrmLiteAuthRepository UpdateUserAuth失败

Authentication 密码未更改时,ServiceStack OrmLiteAuthRepository UpdateUserAuth失败,authentication,servicestack,Authentication,servicestack,我无法通过UpdateUserAuth方法更新UserAuth,以防密码未更改且为空。事实上,UpdateUserAuth方法在计算哈希和salt时考虑了密码为null的情况——如果在第一行中没有调用ValidateNewUser(newUser,password),那么它将起作用。ValidateNewUser检查密码是null还是空,并抛出。 它看起来像一个bug,我不知道如何解决 UpdateUserAuth是一个面向公众的API,因此需要密码来确保只有用户才能更新自己的配置文件 但我刚刚

我无法通过UpdateUserAuth方法更新UserAuth,以防密码未更改且为空。事实上,UpdateUserAuth方法在计算哈希和salt时考虑了密码为null的情况——如果在第一行中没有调用ValidateNewUser(newUser,password),那么它将起作用。ValidateNewUser检查密码是null还是空,并抛出。
它看起来像一个bug,我不知道如何解决

UpdateUserAuth是一个面向公众的API,因此需要密码来确保只有用户才能更新自己的配置文件

但我刚刚为OrmLiteAuthRepository添加了一个新的内部API,您可以在内部使用该API更新用户详细信息,而无需密码:

IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser)

我没有考虑到只有用户可以更新他们的个人资料,并且总是需要密码来确认身份的情况。无论如何,在管理员需要管理用户的场景中,您所做的更改有很大帮助,例如我的用户。非常感谢您的快速响应!