Skip to content

Commit

Permalink
Taken the locale from default json file
Browse files Browse the repository at this point in the history
  • Loading branch information
aranaravi committed Sep 8, 2023
1 parent 7c9f9d4 commit 4c9c7d9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions resident-ui/src/app/core/services/httpinterceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ export class AuthInterceptor implements HttpInterceptor {
next: HttpHandler
): Observable<HttpEvent<any>> {
request = request.clone({ withCredentials: true });
request = request.clone({
// setHeaders: { 'X-XSRF-TOKEN': this.cookieService.get('XSRF-TOKEN') }
if(localStorage.getItem("langCode")){
request = request.clone({
setHeaders: { 'time-zone-offset': this.localTimeZoneOffset, 'locale': defaultJson['languages'][localStorage.getItem("langCode")]['locale'] }
});
});
}else{
request = request.clone({
setHeaders: { 'time-zone-offset': this.localTimeZoneOffset, 'locale': defaultJson['languages']["eng"]['locale']}
});
}
return next.handle(request).pipe(
tap(
event => {
Expand Down

0 comments on commit 4c9c7d9

Please sign in to comment.