@@ -76,16 +76,8 @@ export default class CreateWorkspace extends React.Component<CreateWorkspaceProp
76
76
</ div > ;
77
77
break ;
78
78
case ErrorCodes . NOT_AUTHENTICATED :
79
- const authorizeUrl = gitpodHostUrl . withApi ( {
80
- pathname : '/authorize' ,
81
- search : `returnTo=${ encodeURIComponent ( window . location . toString ( ) ) } &host=${ error . data . host } &scopes=${ error . data . scopes . join ( ',' ) } `
82
- } ) . toString ( ) ;
83
- window . location . href = authorizeUrl ;
84
- statusMessage = < div className = "mt-2 flex flex-col space-y-8" >
85
- < p className = "text-base w-96" > Redirecting to authorize with { error . data . host } …</ p >
86
- < a href = { authorizeUrl } > < button className = "secondary" > Authorize with { error . data . host } </ button > </ a >
87
- </ div > ;
88
- break ;
79
+ const authorizeURL = `/api/authorize?returnTo=${ encodeURIComponent ( window . location . toString ( ) ) } &host=${ error . data . host } &scopes=${ error . data . scopes . join ( ',' ) } ` ;
80
+ return < Redirect push to = { authorizeURL } /> ;
89
81
case ErrorCodes . USER_BLOCKED :
90
82
return < Redirect to = "/blocked" /> ;
91
83
case ErrorCodes . NOT_FOUND :
@@ -206,12 +198,6 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) {
206
198
( async ( ) => {
207
199
const service = getGitpodService ( ) ;
208
200
const { host, owner, repoName, userIsOwner, userScopes, lastUpdate } = p . error . data ;
209
- console . log ( 'host' , host ) ;
210
- console . log ( 'owner' , owner ) ;
211
- console . log ( 'repoName' , repoName ) ;
212
- console . log ( 'userIsOwner' , userIsOwner ) ;
213
- console . log ( 'userScopes' , userScopes ) ;
214
- console . log ( 'lastUpdate' , lastUpdate ) ;
215
201
216
202
if ( ( await service . server . mayAccessPrivateRepo ( ) ) === false ) {
217
203
setStatusMessage ( < LimitReachedPrivateRepoModal /> ) ;
@@ -227,10 +213,7 @@ function RepositoryNotFoundView(p: { error: StartWorkspaceError }) {
227
213
228
214
// TODO: this should be aware of already granted permissions
229
215
const missingScope = authProvider . host === 'github.com' ? 'repo' : 'read_repository' ;
230
- const authorizeURL = gitpodHostUrl . withApi ( {
231
- pathname : '/authorize' ,
232
- search : `returnTo=${ encodeURIComponent ( window . location . toString ( ) ) } &host=${ host } &scopes=${ missingScope } `
233
- } ) . toString ( ) ;
216
+ const authorizeURL = `/api/authorize?returnTo=${ encodeURIComponent ( window . location . toString ( ) ) } &host=${ host } &scopes=${ missingScope } ` ;
234
217
235
218
if ( ! userScopes . includes ( missingScope ) ) {
236
219
setStatusMessage ( < div className = "mt-2 flex flex-col space-y-8" >
0 commit comments