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

the interceptor in your example is deprecated #1

Open
kinizumi opened this issue Oct 16, 2023 · 0 comments
Open

the interceptor in your example is deprecated #1

kinizumi opened this issue Oct 16, 2023 · 0 comments

Comments

@kinizumi
Copy link

instead of class, angular is now moving on to use const for interceptor
the way you mentioning is no longer valid, we'll have to implement the refresh with the new format, e.g.:
export const authInterceptor = (req: HttpRequest, next: HttpHandlerFn): Observable<HttpEvent> => {
return next(newReq).pipe(
catchError((error) => {
// Catch "401 Unauthorized" responses
if (error instanceof HttpErrorResponse && error.status === 401) {
// mergemap refreshtoken call
}
return throwError(error);
}),
);
any idea please?

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

1 participant