Skip to content

Commit

Permalink
Updated PAT length (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-zaytsev authored Sep 20, 2024
1 parent 54956d4 commit efcb995
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/WebApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import url = require('url');
import path = require('path');

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

export function getHandlerFromToken(token: string, allowCrossOriginAuthentication?: boolean): VsoBaseInterfaces.IRequestHandler {
if (token.length === 52) {
if (token.length === 52 || personalAccessTokenRegex.test(token)) {
return getPersonalAccessTokenHandler(token, allowCrossOriginAuthentication);
}
else {
Expand Down

0 comments on commit efcb995

Please sign in to comment.