@@ -9,8 +9,8 @@ import { storePassword, clearPassword } from './commands/managePasswords';
9
9
import { importFromRegistry } from './commands/importFromRegistry' ;
10
10
import { ServerManagerView , ServerTreeItem , SMTreeItem } from './ui/serverManagerView' ;
11
11
import { addServer } from './api/addServer' ;
12
- import { getPortalUriWithCredentials } from './api/getPortalUriWithCredentials' ;
13
12
import { getServerSummary } from './api/getServerSummary' ;
13
+ import { BrowserTarget , getPortalUriWithToken } from './api/getPortalUriWithToken' ;
14
14
15
15
export interface ServerName {
16
16
name : string ,
@@ -78,9 +78,9 @@ export function activate(context: vscode.ExtensionContext) {
78
78
context . subscriptions . push (
79
79
vscode . commands . registerCommand ( `${ extensionId } .openPortalExternal` , ( server ?: ServerTreeItem ) => {
80
80
if ( server ?. contextValue ?. match ( / \. s e r v e r \. / ) && server . name ) {
81
- getPortalUriWithCredentials ( server . name ) . then ( ( uriWithCredentials ) => {
82
- if ( uriWithCredentials ) {
83
- vscode . env . openExternal ( uriWithCredentials ) ;
81
+ getPortalUriWithToken ( BrowserTarget . EXTERNAL , server . name ) . then ( ( uriWithToken ) => {
82
+ if ( uriWithToken ) {
83
+ vscode . env . openExternal ( uriWithToken ) ;
84
84
}
85
85
} ) ;
86
86
}
@@ -89,13 +89,12 @@ export function activate(context: vscode.ExtensionContext) {
89
89
context . subscriptions . push (
90
90
vscode . commands . registerCommand ( `${ extensionId } .openPortalTab` , ( server ?: ServerTreeItem ) => {
91
91
if ( server ?. contextValue ?. match ( / \. s e r v e r \. / ) && server . name ) {
92
- getPortalUriWithCredentials ( server . name ) . then ( ( uriWithCredentials ) => {
93
- if ( uriWithCredentials ) {
94
- //vscode.commands.executeCommand('simpleBrowser.api.open', uriWithCredentials);
92
+ getPortalUriWithToken ( BrowserTarget . SIMPLE , server . name ) . then ( ( uriWithToken ) => {
93
+ if ( uriWithToken ) {
95
94
//
96
95
// It is essential to pass skipEncoding=true when converting the uri to a string,
97
96
// otherwise the encoding done within Simple Browser / webview causes double-encoding of the querystring.
98
- vscode . commands . executeCommand ( 'simpleBrowser.show' , uriWithCredentials . toString ( true ) ) ;
97
+ vscode . commands . executeCommand ( 'simpleBrowser.show' , uriWithToken . toString ( true ) ) ;
99
98
}
100
99
} ) ;
101
100
}
0 commit comments