Skip to content

Commit 742d4a3

Browse files
committed
add spinner to web.js
1 parent c5fe5a3 commit 742d4a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/web.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import axios from "axios";
22
import os from "os";
3+
import ora from "ora";
34
import { buildError } from "./error.js";
45

56
const buildURLQuery = (obj) =>
@@ -12,6 +13,7 @@ export const getSigninUrl = async (accessKeyId, secretAccessKey, sessionToken) =
1213
const destinationUrl = `https://console.aws.amazon.com/console/home`;
1314

1415
try {
16+
const spinner = ora("Fetching sign-in URL..").start();
1517
const response = await axios.get(federationUrl, {
1618
params: {
1719
Action: "getSigninToken",
@@ -30,6 +32,7 @@ export const getSigninUrl = async (accessKeyId, secretAccessKey, sessionToken) =
3032
SigninToken: encodeURI(response?.data?.SigninToken),
3133
});
3234

35+
spinner.stop();
3336
return `${federationUrl}?${urlParams}`;
3437
} catch (err) {
3538
throw buildError("ERR_GET_SIGNIN_URL", `${err}`);

0 commit comments

Comments
 (0)