@@ -32,9 +32,10 @@ import { createTempContext } from "../../core/temp.ts";
3232import { createBundle } from "./bundle.ts" ;
3333import { completeMessage , withSpinner } from "../../core/console.ts" ;
3434import { randomHex } from "../../core/random.ts" ;
35+ import { ensureTrailingSlash } from "../../core/path.ts" ;
3536
36- export const kRSConnect = "rsconnect " ;
37- const kRSConnectDescription = "RS Connect" ;
37+ export const kRSConnect = "connect " ;
38+ const kRSConnectDescription = "RStudio Connect" ;
3839
3940export const kRSConnectServerVar = "CONNECT_SERVER" ;
4041export const kRSConnectAuthTokenVar = "CONNECT_API_KEY" ;
@@ -90,7 +91,8 @@ function removeToken(token: AccountToken) {
9091 rsconnectProvider . name ,
9192 readAccessTokens < Account > ( rsconnectProvider . name ) ?. filter (
9293 ( accessToken ) => {
93- return accessToken . username !== token . name ;
94+ return accessToken . server !== token . server &&
95+ accessToken . username !== token . name ;
9496 } ,
9597 ) || [ ] ,
9698 ) ;
@@ -101,7 +103,9 @@ async function authorizeToken(
101103) : Promise < AccountToken | undefined > {
102104 // ask for server (then validate that its actually a connect server
103105 // by sending a request without an auth token)
104- let server = target ?. url ? new URL ( target . url ) . origin : undefined ;
106+ let server = target ?. url
107+ ? ensureTrailingSlash ( new URL ( target . url ) . origin )
108+ : undefined ;
105109 while ( server === undefined ) {
106110 // prompt for server
107111 server = await Input . prompt ( {
0 commit comments