2

我不确定这是否是一个问题,或者只是我不知道 OrmLiteAuthRepository 应该如何工作。我正在尝试制作一个允许管理员更新用户信息的管理屏幕。我正在使用 OrmLiteAuthRepository.UpdateUserAuth 方法并传入一个空密码来更新除密码之外的所有内容。但是,验证就像我正在创建一个新用户一样运行,并且 ValidateNewUser 要求我有一个不为空的密码,即使在该方法中进一步检查以避免在使用空密码时更新密码。我错过了什么?

这是方法调用的链接

https://github.com/ServiceStack/ServiceStack/blob/master/src/ServiceStack.ServiceInterface/Auth/OrmLiteAuthRepository.cs#L105

4

1 回答 1

3

使用SaveUserAuth,我相信 UpdateUserAuth 用于更新密码,尽管可能是错误的。

UserAuth user = this.AuthRepository.GetUserAuth("bob")
 if (user.Meta == null)
 {
     user.Meta = new Dictionary<string, string>();
 }
 user.Meta.Add("message", "hi bob");
 this.AuthRepository.SaveUserAuth(user);
于 2013-09-10T20:32:20.627 回答