Skip to content

Commit ad301b1

Browse files
author
Anatolii Bolshakov (Akvelon INC)
committed
Added parameter for other handlers
1 parent cf68419 commit ad301b1

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

api/WebApi.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ export function getNtlmHandler(username: string, password: string, workstation?:
5555
return new ntlmm.NtlmCredentialHandler(username, password, workstation, domain);
5656
}
5757

58-
export function getBearerHandler(token: string): VsoBaseInterfaces.IRequestHandler {
59-
return new bearm.BearerCredentialHandler(token);
58+
export function getBearerHandler(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler {
59+
return new bearm.BearerCredentialHandler(token, allowCrossOriginAuthentication);
6060
}
6161

62-
export function getPersonalAccessTokenHandler(token: string): VsoBaseInterfaces.IRequestHandler {
63-
return new patm.PersonalAccessTokenCredentialHandler(token);
62+
export function getPersonalAccessTokenHandler(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler {
63+
return new patm.PersonalAccessTokenCredentialHandler(token, allowCrossOriginAuthentication);
6464
}
6565

66-
export function getHandlerFromToken(token: string): VsoBaseInterfaces.IRequestHandler {
66+
export function getHandlerFromToken(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler {
6767
if (token.length === 52) {
68-
return getPersonalAccessTokenHandler(token);
68+
return getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication);
6969
}
7070
else {
71-
return getBearerHandler(token);
71+
return getBearerHandler(token, allowCrossOriginAuthentication);
7272
}
7373
}
7474

api/handlers/bearertoken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ifm = require('../interfaces/common/VsoBaseInterfaces');
55
import * as resthandlers from 'typed-rest-client/Handlers';
66

77
export class BearerCredentialHandler extends resthandlers.BearerCredentialHandler implements ifm.IRequestHandler {
8-
constructor(token: string) {
9-
super(token);
8+
constructor(token: string, allowCrossOriginAuthentication?: boolean) {
9+
super(token, allowCrossOriginAuthentication);
1010
}
1111
}

api/handlers/personalaccesstoken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ifm = require('../interfaces/common/VsoBaseInterfaces');
55
import * as resthandlers from 'typed-rest-client/Handlers';
66

77
export class PersonalAccessTokenCredentialHandler extends resthandlers.PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler {
8-
constructor(token: string) {
9-
super(token);
8+
constructor(token: string, allowCrossOriginAuthentication?: boolean) {
9+
super(token, allowCrossOriginAuthentication);
1010
}
1111
}

0 commit comments

Comments
 (0)