question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not setting apiBase in the interceptor?

See original GitHub issue

I’m submitting a…

  • Regression (a behavior that used to work and stopped working in a new release)
  • Bug report
  • Performance issue
  • Feature request
  • Documentation issue or request
  • Other… Please describe:

Current behavior

With the apiBase set, it’s not prepending it to the path in HTTP calls. E.g. if I call this.http.get('foo').subscribe(...) I see a call to http://localhost:4200/foo. If specify the full path, e.g. this.http.get('http://myurl.com/foo') it works fine.

Expected behavior

The value of apiBase is prepended to the path in the interceptor.

What is the motivation / use case for changing the behavior?

This is how this used to work in the previous versions. If something changed in how this is expected to work, none of the docs have been updated.

Environment

Angular-Token version: 6.0.2 Angular version: 6.1.1

Bundler

  • Angular CLI (Webpack)
  • Webpack
  • SystemJS

Browser:

  • Chrome (desktop) version 68.0.3440.106
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

Others:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
arjenbrandenburghcommented, Sep 3, 2018

@misham The apiBase is indeed for the auth paths, but also as a security measure. The token headers are only added to calls going to the apiBase server.

1reaction
mishamcommented, Aug 27, 2018

One other update, sign in & sign out plus all the “built-in” functions around auth work just fine. Only the interceptor is not working for some reason.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set the baseUrl for Angular HttpClient?
Use the new HttpClient Interceptor. Create a proper injectable that implements HttpInterceptor : import {Injectable} from '@angular/core'; import {HttpEvent ...
Read more >
Angular: Consuming multiple APIS with Angular HTTPClient in ...
1- First, you need to create a Interceptor using HttpInterceptor: ... APIs in a easy way, but if we need to set headers,...
Read more >
Retrofit 2 — How to Change API Base Url at Runtime
ServiceGenerator.changeApiBaseUrl("http://development.futurest..."); This changeApiBaseUrl() not working.In my project baseUrl working always.
Read more >
Customizing Axios Packages and Configuring Interceptors ...
This tutorial introduces the reader to the concepts of Axios interceptors in Vue.js.
Read more >
z/OS Connect (OpenAPI 2) change history - IBM
PH50643 - The values set for attributes connectionTimeout and ... The omegamonRequestMonitor-2.0 interceptor is not compatible with this level of z/OS ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found