diff --git a/packages/auth/token/simple/simple.interceptor.spec.ts b/packages/auth/token/simple/simple.interceptor.spec.ts index 136c424dcf..d92c101f1d 100644 --- a/packages/auth/token/simple/simple.interceptor.spec.ts +++ b/packages/auth/token/simple/simple.interceptor.spec.ts @@ -98,7 +98,20 @@ describe('auth: simple.interceptor', () => { done(); }); const req = httpBed.expectOne(() => true) as TestRequest; - expect(req.request.url).toBe('/test?token=123'); + expect(req.request.params.has('token')).toBe(true); + expect(req.request.params.get('token')).toBe('123'); + req.flush('ok!'); + }); + it(`in url via full-domain`, (done: () => void) => { + genModule({ + token_send_place: 'url' + }, genModel('123')); + http.get('https://ng-alain.com/test', { responseType: 'text' }).subscribe(value => { + done(); + }); + const req = httpBed.expectOne(() => true) as TestRequest; + expect(req.request.params.has('token')).toBe(true); + expect(req.request.params.get('token')).toBe('123'); req.flush('ok!'); }); }); diff --git a/packages/auth/token/simple/simple.interceptor.ts b/packages/auth/token/simple/simple.interceptor.ts index eb20f47347..43b37883af 100644 --- a/packages/auth/token/simple/simple.interceptor.ts +++ b/packages/auth/token/simple/simple.interceptor.ts @@ -32,10 +32,8 @@ export class SimpleInterceptor extends BaseInterceptor { }); break; case 'url': - const url = this.injector.get(Router).parseUrl(req.url); - url.queryParams[options.token_send_key] = token; req = req.clone({ - url: url.toString() + params: req.params.append(options.token_send_key, token) }); break; }