@@ -71,6 +71,9 @@ export default function LoginModal({ next }: { next: () => void }) {
7171 try {
7272 setError ( null ) ;
7373 setLoginState ( "loading" ) ;
74+ setPkceTimedOut ( false ) ;
75+ setAuthRequestId ( undefined ) ;
76+
7477 const res = await Auth . startUnifiedPortal ( { } ) ;
7578
7679 // Handle social login (Google/GitHub)
@@ -90,9 +93,6 @@ export default function LoginModal({ next }: { next: () => void }) {
9093
9194 if ( isSsoKind && res . issuerUrl && res . idcRegion ) {
9295 // Start PKCE auth
93- setPkceTimedOut ( false ) ;
94- setAuthRequestId ( undefined ) ;
95-
9696 const init = await Auth . startPkceAuthorization ( {
9797 issuerUrl : res . issuerUrl ,
9898 region : res . idcRegion ,
@@ -295,7 +295,6 @@ export default function LoginModal({ next }: { next: () => void }) {
295295 setLoginMethod ( "deviceCode" ) ;
296296 setLoginState ( "not started" ) ;
297297 setError ( null ) ;
298- Auth . cancelPkceAuthorization ( ) . catch ( console . error ) ;
299298 } }
300299 >
301300 Login with Device Code
@@ -322,7 +321,6 @@ export default function LoginModal({ next }: { next: () => void }) {
322321 setLoginMethod ( "deviceCode" ) ;
323322 setLoginState ( "not started" ) ;
324323 setError ( null ) ;
325- Auth . cancelPkceAuthorization ( ) . catch ( console . error ) ;
326324 } }
327325 >
328326 Try authenticating with device code
@@ -336,7 +334,6 @@ export default function LoginModal({ next }: { next: () => void }) {
336334 onClick = { ( ) => {
337335 setLoginState ( "not started" ) ;
338336 setError ( null ) ;
339- Auth . cancelPkceAuthorization ( ) . catch ( console . error ) ;
340337 } }
341338 >
342339 Back
@@ -357,7 +354,13 @@ export default function LoginModal({ next }: { next: () => void }) {
357354 ? ( ) => setTab ( "iam" )
358355 : ( ) => setTab ( "builderId" )
359356 }
360- signInText = { completedOnboarding ? "Log back in" : "Sign in" }
357+ signInText = {
358+ completedOnboarding
359+ ? tab === "builderId"
360+ ? "Login with Builder ID"
361+ : "Login with IDC"
362+ : "Sign in"
363+ }
361364 />
362365 < Button
363366 variant = "ghost"
@@ -563,7 +566,13 @@ export default function LoginModal({ next }: { next: () => void }) {
563566 ? ( ) => setTab ( "iam" )
564567 : ( ) => setTab ( "builderId" )
565568 }
566- signInText = { completedOnboarding ? "Log back in" : "Sign in" }
569+ signInText = {
570+ completedOnboarding
571+ ? tab === "builderId"
572+ ? "Login with Builder ID"
573+ : "Login with IDC"
574+ : "Sign in"
575+ }
567576 />
568577 ) }
569578 </ div >
0 commit comments