@@ -8,10 +8,11 @@ import {
88import { IAwsSsoOidcVerificationWindowService } from "@noovolari/leapp-core/interfaces/i-aws-sso-oidc-verification-window-service" ;
99import { WindowService } from "./window.service" ;
1010import { MessageToasterService , ToastLevel } from "./message-toaster.service" ;
11+ import { AwsCoreService } from "@noovolari/leapp-core/services/aws-core-service" ;
1112
1213@Injectable ( { providedIn : "root" } )
1314export class AppVerificationWindowService implements IAwsSsoOidcVerificationWindowService {
14- constructor ( private windowService : WindowService , private toasterService : MessageToasterService ) { }
15+ constructor ( private windowService : WindowService , private toasterService : MessageToasterService , private awsCoreService : AwsCoreService ) { }
1516
1617 async openVerificationWindow (
1718 registerClientResponse : RegisterClientResponse ,
@@ -62,7 +63,7 @@ export class AppVerificationWindowService implements IAwsSsoOidcVerificationWind
6263 // When the code is verified and the user has been logged in, the window can be closed
6364 verificationWindow . webContents . session . webRequest . onCompleted (
6465 {
65- urls : [ "https://oidc.eu-west-1.amazonaws.com/device_authorization/associate_token" ] ,
66+ urls : this . getAssociateTokenUrls ( ) ,
6667 } ,
6768 ( details , callback ) => {
6869 if ( details . method === "POST" && details . statusCode === 200 ) {
@@ -99,6 +100,10 @@ export class AppVerificationWindowService implements IAwsSsoOidcVerificationWind
99100 } ) ;
100101 }
101102
103+ private getAssociateTokenUrls ( ) {
104+ return this . awsCoreService . getRegions ( ) . map ( ( region ) => `https://oidc.${ region . region } .amazonaws.com/device_authorization/associate_token` ) ;
105+ }
106+
102107 private async openExternalVerificationBrowserWindow (
103108 registerClientResponse : RegisterClientResponse ,
104109 startDeviceAuthorizationResponse : StartDeviceAuthorizationResponse
0 commit comments