Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Fail to authenticate in callback component. #2058

Open
josu-b-dev opened this issue Dec 26, 2024 · 1 comment
Open

[Bug]: Fail to authenticate in callback component. #2058

josu-b-dev opened this issue Dec 26, 2024 · 1 comment

Comments

@josu-b-dev
Copy link

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():
Screenshot 2024-12-26 180530

@rammba
Copy link

rammba commented Jan 6, 2025

Hello @josu-b-dev, can you please check if you have similar behavior to #2040?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants