我有应用在角8和.NET核心。我的应用程序是由Visualu的模板生成的,所以授权也是生成的。
It has been working great but suddenly I get errors like that, when I started my application:
ERROR in api-authorization/authorize.service.ts:78:29 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.
Property 'name' is optional in type 'Profile' but required in type 'IUser'.
78 this.userSubject.next(user.profile);
~~~~~~~~~~~~
api-authorization/authorize.service.ts:89:31 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.
89 this.userSubject.next(user.profile);
~~~~~~~~~~~~
api-authorization/authorize.service.ts:115:29 - error TS2345: Argument of type 'Profile' is not assignable to parameter of type 'IUser'.
115 this.userSubject.next(user && user.profile);
~~~~~~~~~~~~~~~~~~~~
api-authorization/authorize.service.ts:150:42 - error TS2339: Property 'data' does not exist on type 'SignoutResponse'.
150 return this.success(state && state.data);
~~~~
api-authorization/authorize.service.ts:195:5 - error TS2322: Type 'Observable<Profile>' is not assignable to type 'Observable<IUser>'.
Type 'Profile' is not assignable to type 'IUser'.我记得我更新了角质材料,大概仅此而已。我不知道为什么突然间我会犯这些错误。
发布于 2020-04-27 02:17:23
这是我问题的解决方案:https://github.com/dotnet/aspnetcore/issues/17919
@SyntaxWarrior --我遇到了同样的问题。我在我的package.json中修改了它,但这还不够,因为它仍然是通过Packe-lock.json引用的(我想是这样)。
我运行的命令是npm i oidc-client@1.9.1
唯一的问题是它给了我一堆新的与“路由器链接”相关的错误。看起来有一些地方需要将RouterTestingModule导入到api授权规范中。
问题是软件包oidc客户。在1.10.1版中是概要文件。我不得不降级到1.9.1版,现在它开始工作了。
https://stackoverflow.com/questions/61440305
复制相似问题