Skip to content

Commit efcb995

Browse files
author
Maxim Zaytsev
authored
Updated PAT length (#608)
1 parent 54956d4 commit efcb995

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/WebApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import url = require('url');
4949
import path = require('path');
5050

5151
const isBrowser: boolean = typeof window !== 'undefined';
52+
const personalAccessTokenRegex : RegExp = new RegExp('^.{76}AZDO.{4}$');
5253
/**
5354
* Methods to return handler objects (see handlers folder)
5455
*/
@@ -70,7 +71,7 @@ export function getPersonalAccessTokenHandler(token: string, allowCrossOriginAut
7071
}
7172

7273
export function getHandlerFromToken(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler {
73-
if (token.length === 52) {
74+
if (token.length === 52 || personalAccessTokenRegex.test(token)) {
7475
return getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication);
7576
}
7677
else {

0 commit comments

Comments
 (0)