The functionality of the Auth0 Logout feature has ceased to work properly following the

Previously, the code worked flawlessly on Angular version 14. However, after updating to version 17 due to persistent dependency issues, a problem arose.

logout(): void {
    sessionStorage.clear();
    this.auth.logout({ returnTo: window.location.origin });
  }

The issue now is that the 'returnTo' part of the code is underlined in red with the following error message:

Object literal may only specify known properties, and 'returnTo' does not exist in type 'Omit<LogoutOptions, "onRedirect">'.ts(2353)

I attempted to seek help from ChatGPT to resolve this problem and it suggested the following solution:

  logout(): void {
    sessionStorage.clear();
    this.auth.logout({ returnTo: window.location.origin } as any);
  }

Although the red underline is removed with this modification, it results in an error when attempting to log in:

Unable to issue redirect for OAuth 2.0 transaction

Is there anyone who can provide insights into why this error occur?

Answer №1

For the most up-to-date version, the code must now include the logoutParams as shown below:

logout(): void {
    sessionStorage.clear();
    this.auth.logout({ logoutParams: {returnTo: window.location.origin} });
  }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the method for incorporating sorting into a mat-list?

I've searched for various solutions, but none seem to work with mat-list. It's crucial for me because mat-list is the only solution where drag&drop functionality works (I always face this issue with mat-table in tables and I can't find a ...

Tips for Maintaining User Data Across Pages in React using React-Router-Dom and Context

I've been tackling the login functionality of a client-side application. Utilizing React alongside TypeScript, I've incorporated react-router-dom and Context to manage the user's data when they log in. However, upon refreshing the page, the ...

What is the reason behind Typescript errors vanishing after including onchange in the code?

When using VSCode with appropriate settings enabled, the error would be displayed in the following .html file: <!DOCTYPE html> <html> <body> <div> <select> </select> </div> <script&g ...

Creating variables in Typescript

I'm puzzled by the variable declaration within an Angular component and I'd like to understand why we declare it in the following way: export class AppComponent { serverElements = []; newServerName = ''; newServerContent = &apos ...

The debounced function in a React component not triggering as expected

I am facing an issue with the following React component. Even though the raiseCriteriaChange method is being called, it seems that the line this.props.onCriteriaChange(this.state.criteria) is never reached. Do you have any insights into why this.props.onC ...

Having Trouble with Typescript Modules? Module Not Found Error Arising Due to Source Location Mismatch?

I have recently developed and released a Typescript package, serving as an SDK for my API. This was a new endeavor for me, and I heavily relied on third-party tools to assist in this process. However, upon installation from NPM, the package does not functi ...

Angular Error: Control not located at path 'instructions -> 1 ->action'

I am attempting to construct a form with the following structure. Users should have the ability to create multiple entries for the instruction fields. ... this.buttonForm = this.fb.group({ instructions: this.fb.array([ this.fb.group({ ...

Compilation of Angular 6 project is failing due to error TS1005: Expected ',' instead of the symbol used

I keep encountering an error message whenever I try to compile my code. ERROR in src/app/form/form.component.ts(22,39): error TS1005: ',' expected. Below is the snippet of code where the error is pointing: import { Component, OnInit } from &ap ...

ng-click-outside event triggers when clicking outside, including within child elements

I am looking to trigger a specific action when I click outside of the container. To achieve this, I have utilized the ng-click-outside directive which works well in most cases. However, there is one scenario where an issue arises. Inside the container, the ...

How to stop a form from being cleared when a button is clicked in Angular 2

Within my form, there is a button that allows users to add an item to the object's array. <form (ngSubmit)="submit()" #myForm="myForm" class="form-horizontal" style="direction: ltr"> <div class="row"> <div class="col-md-6"> ...

Steps to arrange by the number of rows in ag grid

I've been experimenting with the rows group feature in ag-grid, But I'm curious if it's feasible to sort the group column based on the number of rows within each group? Here is an example of what I am trying to achieve: ...

Typescript's mock function allows developers to create mock implementations of

Here is the code that needs to be mocked: const P = { scripts: { getScripts: (name?: any) => { // do some stuff and return json return { foo: 'value'}; } } } export default P; The code needing ...

Setting up roles and permissions for the admin user in Strapi v4 during the bootstrap process

This project is built using Typescript. To streamline the development process, all data needs to be bootstrapped in advance so that new team members working on the project do not have to manually insert data into the strapi admin panel. While inserting ne ...

NextJS compilation sometimes results in undefined errors when using Sass styles

My peace lies in the sass code: .link display: inline-table text-align: center align-self: center margin: 5px 15px font-size: 20px color: black text-decoration: none transition: 0.1s ease-in-out .link:hover text-decoration: underline .l ...

The custom validator in Material2 Datepicker successfully returns a date object instead of a string

Im currently working on developing a unique custom validator for the datepicker feature within a reactive form group. Within my code file, specifically the .ts file: form: FormGroup; constructor( private fb: FormBuilder, ...

Sending HTTP POST request with FormData from an Angular2 client to a Node server

I am having trouble sending a file from my Angular2 client to my NodeJS server using http and a FormData object. upload.html ... <input #fileinput type="file" [attr.multiple]="multiple ? true : null" (change)="uploadFile()" > ... upload.component. ...

You must provide a secret or key in order to use the JwtStrategy

I have encountered the following error and I am unsure of its cause. Can you assist me? ERROR [ExceptionHandler] JwtStrategy requires a secret or key TypeError: JwtStrategy requires a secret or key at new JwtStrategy (C:\Users\wapg2\OneDriv ...

Angular 2 component: Harnessing the power of boolean inputs

I am currently working on creating a reusable component for my application that may display a control button at times and hide it at others. My ideal scenario would involve utilizing the presence or absence of an attribute to determine whether the control ...

What could be causing the increased build size of my Polymer2 compared to Angular5?

After reading multiple blogs, I decided to go with the polymer2 framework instead of angular. Some sources claimed that Polymer contributes less to the build size for production compared to angular2/5. To test this theory, I created two demo projects - on ...

Struggling to implement cookie functionality in Go language

I've been trying to figure out the issue by watching videos like this one and checking out this link. There's also a similar question on Stack Overflow This is the code I've been working with: func articlesHandler(w http.ResponseWriter, r * ...