我正在使用 Silhouette 来管理我的 Play 应用程序中的身份验证。注册,登录和授权工作正常。但是,当尝试注销(= 删除)用户帐户时,删除相应的身份验证信息会失败。
特别是,以下行会引发异常:
authInfoRepository.remove(LoginInfo(credentialsProvider.id, username))
(authInfoRepository
是一个注入的AuthInfoRepository
,它被配置为一个DelegableAuthInfoRepository
)
例外:
com.mohiva.play.silhouette.api.exceptions.ConfigurationException: Cannot remove auth info of type: class scala.runtime.Nothing$; Please configure the DAO for this type
at com.mohiva.play.silhouette.persistence.repositories.DelegableAuthInfoRepository.remove(DelegableAuthInfoRepository.scala:115)
[...]
查看有问题的方法,它需要一个隐式参数implicit tag: ClassTag[T]
。那个最终以某种方式结束Nothing
,在我看来这是错误的,但我不完全理解发生了什么,或者预期会发生什么。
- 应该如何
AuthInfoRepository#remove
正确称呼?我是否需要手动将ClassTag
对象放入正确的上下文以避免Nothing
被推断? - 为什么隐式
ClassTag
参数甚至相关?