File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -274,7 +274,9 @@ async function _connectConvexProjectForMember(
274274 const text = await response . text ( ) ;
275275 const defaultProvisioningError = new ConvexError ( {
276276 code : "ProvisioningError" ,
277- message : `Failed to create project: ${ response . status } ` ,
277+ message : text . includes ( "SSORequired" )
278+ ? "You must log in with Single Sign-on to access this team."
279+ : `Failed to create project: ${ response . status } ` ,
278280 details : text ,
279281 } ) ;
280282 if ( response . status !== 400 ) {
@@ -327,7 +329,9 @@ async function _connectConvexProjectForMember(
327329 const text = await projectDeployKeyResponse . text ( ) ;
328330 throw new ConvexError ( {
329331 code : "ProvisioningError" ,
330- message : `Failed to create project deploy key: ${ projectDeployKeyResponse . status } ` ,
332+ message : text . includes ( "SSORequired" )
333+ ? "You must log in with Single Sign-on to access this team."
334+ : `Failed to create project deploy key: ${ projectDeployKeyResponse . status } ` ,
331335 details : text ,
332336 } ) ;
333337 }
Original file line number Diff line number Diff line change @@ -643,6 +643,8 @@ async function tryDeleteProject(args: {
643643 const error = JSON . parse ( text ) ;
644644 if ( error . code === "TeamNotFound" ) {
645645 return { kind : "error" , error : `Team not found: ${ teamSlug } ` } ;
646+ } else if ( error . code === "SSORequired" ) {
647+ return { kind : "error" , error : `You must log in with Single Sign-on to access this team.` } ;
646648 }
647649 return { kind : "error" , error : `Failed to fetch team projects: ${ projectsResponse . statusText } ${ text } ` } ;
648650 } catch ( _e ) {
@@ -663,7 +665,12 @@ async function tryDeleteProject(args: {
663665
664666 if ( ! response . ok ) {
665667 const text = await response . text ( ) ;
666- return { kind : "error" , error : `Failed to delete project: ${ response . statusText } ${ text } ` } ;
668+ return {
669+ kind : "error" ,
670+ error : text . includes ( "SSORequired" )
671+ ? `You must log in with Single Sign-on to delete this project.`
672+ : `Failed to delete project: ${ response . statusText } ${ text } ` ,
673+ } ;
667674 }
668675 }
669676
You can’t perform that action at this time.
0 commit comments