Commit 0d1a8c7
committed
fix: attach Builder authtoken to AuthInterceptor and prevent duplicate authtoken headers
Two related authentication bugs:
1. Contentstack.Builder.setAuthtoken() stored the token on the client but
never wired it into AuthInterceptor - only login() did. Clients built
via setAuthtoken() silently sent no authtoken header at all; requests
only worked when an authorization (management token) header masked it.
2. AuthInterceptor used addHeader(), so requests that already carried an
explicit authtoken (e.g. via @HeaderMap) received a duplicate header
and were rejected as unauthenticated. The client-level token is now
attached only when the request does not already have one.1 parent d3da24d commit 0d1a8c7
2 files changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
1063 | | - | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1064 | 1068 | | |
1065 | 1069 | | |
1066 | 1070 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
0 commit comments