angular-auth-oidc-client
angular-auth-oidc-client copied to clipboard
[Bug]: Fail to authenticate in callback component.
Version
18.0.2
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
I'm getting : `ERROR TypeError: Cannot read properties of null (reading 'last_login_ip')` during the checkAuth() call. The whole `userData` object is returning `null`.
Steps to reproduce the behavior
1. Set callBack component.
2. call this.oidcSecurityService.checkAuth()
3. add console.log() inside checkAuth() call to see returning data
It fails the authentication and returns null userData.
A clear and concise description of what you expected to happen.
Returns isAuthenticated: true and the userData correctly, as it did in version 18.0.1 with the exact same code.
Additional context
Our callback component:
export class CallbackComponent {
constructor(
private router: Router,
private oidcSecurityService: OidcSecurityService,
private tokenService: TokenService,
private authService: AuthService,
private auditService: AuditService,
private activatedRoute: ActivatedRoute,
) {
this.oidcSecurityService.checkAuth().subscribe({
next: (data) => {
console.log(data); // returns userData null and isAuthenticated false in v18.0.2
console.log(activatedRoute); // returns the same in v18.0.2 and 0.1
const { userData, accessToken } = data;
void this.router.navigate(["consult"]);
},
});
}
}
Error Message and checkAuth() returning data console.log():
Hello @josu-b-dev, can you please check if you have similar behavior to #2040?
Is that issue still existing? Do you have a sample repo?
Any update about this? I am facing this issue