Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
144 views

I am working with an Angular HTTP interceptor and handling various error status codes. However, I have an issue with handling the 429 (Too Many Requests) error code. While the backend correctly ...
Nicker Pasco's user avatar
1 vote
1 answer
257 views

I have an Angular v19 project. I have the following AuthInterceptor @Injectable() export class AuthInterceptor implements HttpInterceptor { private isRefreshing = false; constructor(private ...
Code Ratchet's user avatar
  • 6,079
1 vote
2 answers
179 views

I want to use a simple method to check for internet connectivity. We have a file hosted on a server and I simply want to check that we can see it. The file contains: { "status": "...
Rob Mousley's user avatar
2 votes
1 answer
111 views

I am implementing a loading spinner that runs for all my http requests via an HttpInterceptorFn using this blog post as a guide: https://blog.angular-university.io/angular-loading-indicator/ loading....
Asad Koths's user avatar
1 vote
1 answer
707 views

My interceptor doesn't work in Angular version 18. The backend says it can't add the header to the request: Pre-authenticated entry point called. Rejecting access 2024-09-29T12:39:52.861+02:00 DEBUG ...
Stefano Antonetti's user avatar
1 vote
2 answers
523 views

I can't solve the implementation of refresh tokens, my backend is OK at PostMan works OK, with a curl command it's OK too, I send the header with a refresh token and the backend responses with an ...
Gustavo Starace's user avatar
1 vote
1 answer
67 views

I am trying to replay a failed request once a token has been refreshed. Following this as a guide. My http interceptor: isRefreshingToken: boolean = false tokenSubject: Subject<void> = new ...
lostintranslation's user avatar
1 vote
1 answer
370 views

Developing Angular 17 SSR applications, JWT Authentication I developed login component, and trying to get the user info from JWT. But, I'm not able to work with Interceptor & localStorage ...
Varanasi Phaneendra's user avatar
0 votes
1 answer
81 views

In the new definition of interceptors in Angular 17, the local use of a BehaviorSubject does not work. I have an interceptor that seeks to fulfill the use case of the refreshToken by seeking to ...
alegeomx's user avatar
1 vote
0 answers
389 views

I am currently using Angular 18 for my application and my application is modular-based. Previously, my application was developed using Angular 16, but I have recently upgraded it to Angular 18. ...
Tauseef Arshad's user avatar
1 vote
1 answer
111 views

In my library, There is an interceptor that the user must provide in order for the component to work. I want to throw an exception if the user forgets to provide the interceptor, maybe from a ...
Murhaf Sousli's user avatar
0 votes
1 answer
200 views

In my library, I export a http interceptor. Currently to activate the interceptor, the user must use the following code: import { provideNgProgressHttp, progressInterceptor } from 'ngx-progressbar/...
Murhaf Sousli's user avatar
2 votes
3 answers
2k views

I tried to implement the interceptor concept in my angular demo project but I'm getting error on httpInterceptor line 7 i.e `export const httpInterceptor: HttpInterceptorFn = (req, next) => {` I'm ...
user25293681's user avatar
2 votes
2 answers
5k views

My AuthInterceptor.intercept method is not getting called. Putting all necessary codes below. My code flow: FormSubmit() method from login.component calls the generateToken() method from login.service(...
Vivek Dama's user avatar
3 votes
2 answers
263 views

My interceptor code: import { Injectable } from '@angular/core'; import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpErrorResponse, ...
SGR's user avatar
  • 2,375
-1 votes
1 answer
128 views

I made an interceptor-service for adding a auth-header to every HTTP-request. Service @Injectable () export class HttpInterceptorService implements HttpInterceptor { token : string = undefined; ...
chris01's user avatar
  • 12.7k
2 votes
1 answer
70 views

When the token gets expired next: HttpHandler handle the request that comes from the server when it go inside the refershToken Subscribe method it goes to the header that I defined above the next....
Pranav Barot's user avatar
19 votes
7 answers
33k views

I'm learning angular through course and currently I'm learning about Interceptors. The angular version in the course isn't 17 but the one which I'm using in my local is. So, after 1st trying to ...
shivendra yadav's user avatar
0 votes
2 answers
960 views

I wanna use snack bar to show users the error, I want to know if I have to use error in my subscription method to use snack bar? is there any way to not use error in subscribe method and show error ...
Amir Abaris's user avatar
2 votes
2 answers
2k views

Angular version 16, MoneyComponent is a standalone component. Application structure is src\app\pages\money. Only one page moneyForms needs interceptor to send in additional info to API HttpPost, so ...
Jeb50's user avatar
  • 7,147
0 votes
1 answer
2k views

I want stream real time data from server to client. We are using Angular 16. I want to intercept the Request and Response of WebSockets, Server Sent Events (SSE) and ReadableStream using Angular ...
Hari Prasad's user avatar
0 votes
1 answer
679 views

I am doing it as follows but this is not possible as boostrapapplication expects 1 or 2 arguments. import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/...
Victor's user avatar
  • 1
0 votes
0 answers
141 views

I want to create an interceptor (or any other solution that will affect all the services), that will hold the POST requests for ~300ms and in case there are new POST requests in that time gap, will ...
Harel Malichi's user avatar
0 votes
1 answer
473 views

There is now new method of providing HttpClient as provideHttpClient function. This also can take withInterceptors() function to define interceptors. I have shared module as a separate dependency that ...
ThaFog's user avatar
  • 529
0 votes
1 answer
125 views

I have an Angular project where I want to use a token. After about 1/2 hour, the interceptor should call a refresh endpoint and get a new token. But I am having trouple getting it to work. import { ...
Johansrk's user avatar
  • 5,280
0 votes
0 answers
362 views

<img [src]="url" *ngIf="!isimageloading"> in a form with submit in html in component fetchImage(form:NgForm) { this.url="http://localhost:3000/getimage/"+...
art music's user avatar
1 vote
1 answer
548 views

I have created an interceptor to add header, so that I don't have to manually add header to each http request. But the moment I add service call inside my interceptor it wouldn't trigger, I am not ...
Umamaheswararao Meka's user avatar
0 votes
1 answer
160 views

Is it possible to apply interceptors in Angular only to POST requests?
Sakén's user avatar
  • 314
2 votes
1 answer
1k views

This is an Angular functional interceptor created to manage possible session timeouts during application usage. export const sessionExpiredInterceptor: HttpInterceptorFn = (req, next) => { ...
Bruno Miguel's user avatar
  • 1,145
0 votes
0 answers
74 views

I am trying to show Unauthenticated dialog and let user to click on the return to logging page when there is 403 error. Below code works fine but dialog is getting disappear immediately before user ...
Mukesh's user avatar
  • 73
0 votes
1 answer
389 views

Please find my below use case: There is a backend web service developed in Java running at http://localhost:8080 and an angular UI application running at http://localhost:4200. Now my requirement is ...
Rohit's user avatar
  • 480
9 votes
2 answers
5k views

I'm trying to implement a global error notification but I'm not managing to inject anything into the Interceptor and the worst thing is that it doesn't give an error, it just doesn't work, if anyone ...
Brendon Santos's user avatar
0 votes
1 answer
427 views

I am unit testing a little error-handling interceptor and I want to test that a certain function has been called with arguments. The toHaveBeenCalledWith function gives a "but it was never called&...
Harald's user avatar
  • 1
0 votes
0 answers
567 views

I built a small spring boot application using spring-boot-starter-oauth2-resource-server. The tests work well on Postman but not on Angular. The test was working on Angular when I used spring-boot-...
DONGMO BERNARD GERAUD's user avatar
0 votes
1 answer
90 views

I have an Angular 14 app that I'm just starting out with that will be using Authorization headers to call a webapi (c#) in a different domain, so CORS is hitting me. What I can't figure out is how to ...
Nick Jacobs's user avatar
0 votes
1 answer
651 views

I'm adding custom params for API's for some use case which is not require to send it BE and I want to delete them before sending to BE. Url: https://www.dummy.com?reload=true params: req.params.delete(...
Arun M's user avatar
  • 153
1 vote
1 answer
475 views

I'm developing an Angular app that requires MS credentials for get logged in. Furthermore I'm using an Http Interceptor for showing up a loader component when any HttpClient's call is in use. My ...
FranciscoPoloV's user avatar
0 votes
0 answers
1k views

I am trying to call API service inside the interceptor. My API service code: showAcknowledgement() { this.noticeService.getNotice(ConstUrls.NoticeManagement.GetUserNotice).subscribe((data: any) =&...
Mohamed Abubakar's user avatar
0 votes
0 answers
741 views

I have a weird problem. I hope I would be able to explain. I am encrypting something in the backend and API response returns a plain string in encrypted format something like this: jZAYo65r+...
Aakash Kumar's user avatar
-1 votes
1 answer
982 views

I have created a Rest API using springBoot and using Postman for creating GET, POST, PUT ,Delete Requests. To display data to enduser i am using Angular . My Application is Read only for enduser , and ...
VJain's user avatar
  • 1,069
5 votes
0 answers
500 views

I'm working on an Angular 10 application that uses an HttpInterceptor for adding a specific header to all responses. Unfortunately, when trying to test this interceptor, I keep getting the following ...
Cameron's user avatar
  • 78
2 votes
1 answer
852 views

How can I read the response header of XHR call by $http in Angular (v8+) as its status is 302 and it is redirected by browser? In my case as the redirect url has a different origin, I only get an ...
RezKesh's user avatar
  • 2,964
0 votes
1 answer
1k views

I've written an Angular 9 HTTP Interceptor, and I would like to unit test the intercept function in relative isolation. From what I've seen on StackOverflow already, people are suggesting to make fake ...
Will's user avatar
  • 11
4 votes
2 answers
3k views

I have application in Angular and I have only one HttpClientModule, but when I provide HttpClient in constructor like this: export class UserService { constructor(private http: HttpClient /** <---...
Viszman's user avatar
  • 1,398
0 votes
0 answers
801 views

I used HttpInterceptor to set the "bearer token" heading to log in Angular, when I log in the server returns a token and I save it in a Response variable but I need a Request variable that is why I ...
ardoYep's user avatar
  • 125
0 votes
0 answers
327 views

I'm getting this error, with ionic serve is working fine in the browser, but when i ran ionic cordova emulate android or ios is not working as expected, i tried to fetch another url and with another ...
Luichito1987's user avatar
3 votes
1 answer
746 views

I read other topics but none of them reflects my problem. Background first - we got an Angular App which works in two modes - in first mode applications uses one API and in the second one - another ...
ppotera's user avatar
  • 61
0 votes
0 answers
319 views

I'm implementing an angular interceptor service which looks for error and shows a snackbar, now I'm trying to add functionality to handle "No internet" or "Slow Internet". I tried with timeout ...
Habeeb Rahman's user avatar
0 votes
2 answers
1k views

I'm currently trying to implement a CanDeactivate Guard to my angular application which already had HTTP Interceptor to resolve for authentication. But adding the CanDeactivate guard is throwing ...
Debadatta Meher's user avatar
0 votes
1 answer
24 views

I have a request to search the notifications that match with an user input search, but each notifications that match have a newsId properties, I want when I got the notification from server, make ...
Raudel Costa's user avatar