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/http';
import { environment } from '../../../environments/environment'
export const REFRESHER_TOKEN_INTERCEPTOR = new HttpContextToken(() => false)
export const authInterceptor: HttpInterceptorFn = (req, next) => {
//By dafault, the interceptor will try to pass the JWT token but for the refresherToken we must pass the refresher token instead
const jwtToken = getJwtToken(req.context.get(REFRESHER_TOKEN_INTERCEPTOR));
if (jwtToken) {
var cloned = req.clone({
setHeaders: {
Authorization: `Bearer ${jwtToken}`
}
})
return next(cloned)
}
return next(req);
};
The reason why I'm asking, it's in case of refresher token mechanism, I would like to send another token
Find a way to retrieve the query or mutation name from within the interceptor