File tree 2 files changed +13
-9
lines changed
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,16 @@ export default async function setupCredentials(): Promise<void> {
15
15
}
16
16
17
17
// store settings
18
- setConfigurationByKey (
19
- CONFIG . BASE_URL ,
20
- await vscode . window . showInputBox ( {
21
- ignoreFocusOut : true ,
22
- password : false ,
23
- placeHolder : 'Your Jira url'
24
- } )
25
- ) ;
18
+ let newBaseUrl = await vscode . window . showInputBox ( {
19
+ ignoreFocusOut : true ,
20
+ password : false ,
21
+ placeHolder : 'Your Jira url'
22
+ } ) ;
23
+ // remove / at the end
24
+ if ( ! ! newBaseUrl && newBaseUrl . substring ( newBaseUrl . length - 1 ) === '/' ) {
25
+ newBaseUrl = newBaseUrl . substring ( 0 , newBaseUrl . length - 1 ) ;
26
+ }
27
+ setConfigurationByKey ( CONFIG . BASE_URL , newBaseUrl ) ;
26
28
27
29
setConfigurationByKey (
28
30
CONFIG . USERNAME ,
Original file line number Diff line number Diff line change @@ -35,10 +35,12 @@ export class Jira implements IJira {
35
35
36
36
if ( this . baseUrl && getGlobalStateConfiguration ( ) ) {
37
37
const parsedUrl = url . parse ( this . baseUrl ) ;
38
+ // host from parsedUrl.href because the base url can have subfolder
39
+ const host = parsedUrl . href . replace ( parsedUrl . protocol + '//' , '' ) ;
38
40
const [ username , password ] = getGlobalStateConfiguration ( ) . split ( CREDENTIALS_SEPARATOR ) ;
39
41
40
42
this . jiraInstance = new jiraClient ( {
41
- host : parsedUrl . host ,
43
+ host : host ,
42
44
port : parsedUrl . port ,
43
45
protocol : parsedUrl . protocol ,
44
46
basic_auth : { username, password }
You can’t perform that action at this time.
0 commit comments