Skip to content

Commit

Permalink
feat: add fallback region
Browse files Browse the repository at this point in the history
  • Loading branch information
Jnig committed Nov 23, 2023
1 parent 0045df0 commit 00d11ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/assume.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function getCredentialsAndWrite(account) {
sso_region: sso_region,
sso_account_id: account.accountId,
sso_role_name: account.role,
region: vt_default_region,
region: vt_default_region || "eu-central-1",
});

console.log(
Expand Down Expand Up @@ -95,7 +95,9 @@ export async function openConsole({ accountId, role, name }) {
const { SigninToken } = data;

const { vt_default_region } = await getCurrentSession();
const destination = `https://${vt_default_region}.console.aws.amazon.com/`;
const destination = `https://${
vt_default_region || "eu-central-1"
}.console.aws.amazon.com/`;
const loginUrl = `${baseUrl}?Action=login&Destination=${encodeURIComponent(
destination,
)}&SigninToken=${encodeURIComponent(SigninToken)}`;
Expand Down

0 comments on commit 00d11ec

Please sign in to comment.