Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
137 views

httpResource got released as an experimental feature in Angular 19.2. The httpResource uses the HttpClient under the hood. So I was hoping, I would be able to pass all the options I could pass to the ...
T. Jami's user avatar
  • 1,169
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
53 views

Imagine the situation where you provide any lib to client. Simple scenario, spinner interceptor which needs spinner service. In old way it was possible to: providers: [ { provide: ...
turtle's user avatar
  • 41
2 votes
1 answer
122 views

Listen, I'll explain how it all happens. I'm making a refresh system for a jwt token. It's a standard thing. I configured exactly two systems: guards and interceptors. That's why I'm sure people will ...
Андрій Степанов's user avatar
1 vote
1 answer
79 views

I have a weird behavior with my requests. If the request throw an error, I automatically get a second one launched Here is an example of my request : this.http.post(environment['url'] + '/ws/verifier/...
Nathan30's user avatar
  • 1,093
0 votes
2 answers
103 views

I'm facing the error expression has changed after it was checked. I know, that this check runs only in dev mode (runs twice) and that I won't have the error message in prod. But I want to know why I ...
derstauner's user avatar
  • 1,958
0 votes
0 answers
73 views

I have an interceptor for refreshing an access token, when it doesn't refresh, everything's all good, but when it does, the unfortunate request that happened to pass through it when it decided to ...
Symtax's user avatar
  • 25
0 votes
1 answer
41 views

I have an interceptor that is supposed to refresh an access token if it's expired and continue the request with the new token, but its just looping a lot (not infinitely, something is stopping it ...
Symtax's user avatar
  • 25
1 vote
1 answer
52 views

there is an issue. I have Angular 17 app. There is a need to get a user data by http request as to keep it in localStorage and use everywhere. The request should be send once only and as earlier as ...
Alex Marat's user avatar
0 votes
0 answers
62 views

I am facing an issue with the switchMap in interceptor. But in angular service it works fine. unable to find the reason why switchMap is not executing its code. Need help please. getAccessToken ...
chetan s's user avatar
0 votes
1 answer
108 views

I am trying to implement the the refresh jwt token mechanism in an interceptor. I am following the accepted answer way in this post Angular - Waiting for refresh token function to finish before ...
Pawan Nogariya's user avatar
5 votes
1 answer
419 views

I'm trying to set up provideHttpClient in Angular v19 to use route-specific interceptors, but I'm encountering an issue where no requests are intercepted. My Setup: I have a default ApplicationConfig ...
Gykonik's user avatar
  • 706
1 vote
1 answer
234 views

This is a simplified version of my Angular 18 error interceptor. It will retry requests that produced an error to make sure it was not a fluke (please don't ask!). This works, however I am running ...
Chris Barr's user avatar
  • 34.7k
1 vote
1 answer
51 views

I'm looking for a solution to re-execute the same HTTP query after a catch is completed. For instance, as per below, I would like to re-execute the same call as the catch hanlded properly the re-...
DanyBoy's user avatar
  • 21
0 votes
1 answer
42 views

Good morning everyone, I would need your help to retrieve the query or mutation name within the interceptor which is working fine. import { HttpContextToken, HttpInterceptorFn } from '@angular/common/...
DanyBoy's user avatar
  • 21
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
2 votes
1 answer
94 views

I want to do token-based authorization with angular, but I have a bug like this I can protect pages with auth guard if the token has not exploded, but I cannot use the interceptor because auth guard ...
Erenb's user avatar
  • 21
1 vote
2 answers
74 views

I have created an interceptor to ensure that every request sends HttpOnly JWT/refresh tokens. I am attempting to refresh my short-lived JWT by catching a 401 error and asking the server for a refresh. ...
Asad Koths's user avatar
0 votes
3 answers
308 views

I'm using ngrx signal store, and I have a login method that updates my state with isAuthenticated: true and token: token. It also stores the token in localStorage. I have a withComputed((store) => (...
Zed's user avatar
  • 95
1 vote
0 answers
200 views

I'm working on an Angular 17 application where I'm trying to add an Authorization Bearer token to the request headers upon login. However, I'm facing an issue where the HttpInterceptor retrieves null ...
Kenbrnbe's user avatar
0 votes
1 answer
240 views

I am developing an application with the following stack Frontend - Angular Backend - JAVA Springboot Both the applications are hosted on the same domain. When I am logging into my application, the ...
Suman Rana's user avatar
1 vote
1 answer
159 views

I believe with standalone component and HttpInterceptor has a bug! export const appConfig: ApplicationConfig = { providers: [ // provideHttpClient(withInterceptorsFromDi()), // { provide: ...
Tonyfilho's user avatar
2 votes
1 answer
3k views

In angular 18, I need to set API URL after the app initialisation(because for obvious reason, fetching of URL from a json file). However it is not setting. In fact InjectionToken has set before ...
skdonthi's user avatar
  • 1,472
0 votes
2 answers
65 views

I use this function to login: login() { this.authService.login(this.ngForm.value).subscribe({ next: (response) => { const loginData = response; this.user = loginData.user; this....
quma's user avatar
  • 5,797
1 vote
1 answer
497 views

I'm working on an Angular application with an HTTP interceptor for handling authentication tokens. I'm facing a couple of challenges and need guidance on best practices. The interceptor currently ...
Muhammad-Ali's user avatar
1 vote
5 answers
7k views

I'm setting up a JWT interceptor in Angular 18.. I had this set up in Angular 8, although that was a completely different setup using a class which inherits HttpInterceptor. here I am using function ...
Jessie Lulham's user avatar
2 votes
2 answers
2k views

Angular is not aknowledging the interceptor. So basically I executed ng generate interceptor JwtInterceptor and setup set it up to add the token to the header : import { HttpErrorResponse, ...
EagleMind's user avatar
  • 109
1 vote
2 answers
1k views

I have an interceptor that adds the access token to every request. The only problem is, the only way I can get this access token is by using a function that returns a Promise: async getToken(): ...
6godddd's user avatar
  • 35
0 votes
2 answers
52 views

let data = { ticketId: id }; this.apiService .call("tickets", "/detail", "GET", true, data, null) .pipe(first()) .subscribe( (data) => { data = this....
Lokesh Lokhande's user avatar
2 votes
1 answer
647 views

I have been trying to create a loading spinner in my Angular application. I found an interesting tutorial here. It was all going pretty well, until the final step, when I need to actually create the ...
nbofni's user avatar
  • 47
2 votes
1 answer
1k views

I am working on an Angular 17 project and need to implement a loading spinner that displays during HTTP calls. I want the spinner to show when a request or several is made and hide once the response ...
coder's user avatar
  • 715
0 votes
1 answer
403 views

In my app I created by using Angular 17 I have a very simple interceptor: import { HttpInterceptorFn } from '@angular/common/http'; import { HttpBodyModel } from "../models/http-body.model"; ...
Archimede's user avatar
  • 737
1 vote
1 answer
106 views

I show an alert based on the http response returned in Angular. My code works in Get and post methods, but not in put and delete methods.I'm stuck here and would be very happy if someone could help me....
Kadir Ersezer's user avatar
1 vote
1 answer
926 views

how do I inject an interceptor to an application generated as a modular app in angular 17? I mean the one generated with the --standalone argument? I tried injecting it as [provideHttpClient(...
Milton Isaya's user avatar
0 votes
1 answer
628 views

In an Angular 17 project, with HttpInterceptorFn, I meet a concern when renewing an authentication token. Indeed, when two requests arrive while the two have an expired token, two renewal requests are ...
KurtGL's user avatar
  • 3
1 vote
1 answer
173 views

I'm receiving some multipart/mixed content from a server that contains some JSON as well as bytes and need to parse it into an object in Angular. This is how I send out my request: public sendRequest(...
TigersEye120's user avatar
1 vote
0 answers
190 views

I am using Angular 17 with the NgRx pattern. I'm trying to implement an interceptor to append the correct headers to requests made to the backend. In particular, the logic to follow, according to the ...
Aurora's user avatar
  • 187
0 votes
1 answer
158 views

I'm facing an issue with ngx-translate while integrating it with an interceptor in my Ionic Capacitor application. When attempting to access the translate service within the interceptor, I facing the ...
Sierra's user avatar
  • 69
1 vote
1 answer
2k views

I'm having trouble when my interceptor is intercepting a request based on a JWT expiration. I'm able to perform the refresh of the token, but the original request is never retried again. I have the ...
Alex Perez's user avatar
0 votes
1 answer
856 views

I'm currently working on implementing a refresh token mechanism in my Angular frontend. When my backend returns a 401 error, my error interceptor handles it. However, I'm facing an issue: when my ...
AntoBoy's user avatar
  • 76
16 votes
3 answers
12k views

Here is my interceptor using the new way of intercept of angular, using a function instead of a class export const errorInterceptor: HttpInterceptorFn = (req, next) => { console.log('Intercepted')...
GuilhermeMarques's user avatar
3 votes
2 answers
5k views

I was using the following class-based interceptor to refresh user token: @Injectable() export class AuthInterceptor implements HttpInterceptor { constructor(private inject: Injector) {} ...
Alex Wright's user avatar
2 votes
1 answer
522 views

Question comming from a front-end beginner. I would like to add csrf tokens to some of the requests in a frontend app. The application is using Angular in version 12.2.17. I follow instructions from ...
fascynacja's user avatar
  • 3,196
0 votes
0 answers
42 views

Interceptor event always throws error and error block geting exicuting. We are upgrading our existing angular10 application to Angular 15. After upgradation we are facing issue whicle login to ...
davidArchA's user avatar
0 votes
1 answer
656 views

I am trying to do a service call in the interceptor with below code piece-enter image description here However i am getting below error after running it-enter image description here SO when i put a ....
Shafaque Ahmed's user avatar
1 vote
2 answers
1k views

I have defined an http interceptor. Inside the interceptor I have the following code: let newReq = req.clone({ withCredentials: true, responseType: 'json' }); Now I need to modify all requests ...
Manos Kounelakis's user avatar
0 votes
0 answers
121 views

# import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; # import { Injectable } from '@angular/core'; # import { Observable, interval } from 'rxjs'; # import { ...
rishi jha's user avatar
0 votes
0 answers
126 views

All of the examples that I'm following (https://github.com/bartosz-io/jwt-auth-angular), do not have a subscribe in the code, but it is the only way I can get my interceptor function to work. Notice ...
bradrice's user avatar
  • 1,817
1 vote
1 answer
539 views

I am running into a strange issue when using error catching within my Angular HTTP Interceptor code. It seems that code in my chain of ".then()" statements is triggering out of order somehow....
lexitron's user avatar
2 votes
1 answer
642 views

I have an Angular application that uses JWT tokens for authentication. When an HTTP request returns a 401 error (unauthorized), I need to refresh the token and retry the request. My previous Question ...
RAHUL KUNDU's user avatar

1
2 3 4 5
18