How to run code after success authorization

I build the login like in the quickstart tutorial:

But I couldn’t figure out how to execute code after successful authentication. After redirecting, bugs may occur later, as the target page may change later. So I have to enter right after the implicit callback.

Solved. I created my own callback component and added it to the route.

Callback Component:

  template: ''
export class AuthenticationCallbackComponent {

  constructor(private oktaAuth: OktaAuthService) {
    oktaAuth.handleAuthentication().then( () => {;

  private run() {
    // Run some code after auth


  component: AuthenticationCallbackComponent,