Open
Description
I just upgraded to version 12 and face an issue with loading the userinfo.
After PR #939 the return type of loadUserProfile()
changed from Userinfo
to Userinfo | string
and now to object
.
I thought, I could still at least cast to Userinfo, but weirdly the response is wrapped like this:
{
"info": {
"sub": "...",
"name": "...",
...
}
}
instead of
{
"sub": "...",
"name": "...",
...
}
so that I would have to call
private userinfoSubject$ = new ReplaySubject<UserInfo>();
...
this.oauthService.loadUserProfile().then(userinfo => {
// tslint:disable-next-line
this.userinfoSubject$.next(userinfo['info'] as UserInfo);
...
}
I would really like to find a cleaner solution to this.
Is the response wrapped in "info" on purpose?
And why did the response type change from Userinfo | string
to object
?