Question: is there a solution for a popup to appear **on all the pages** of the application if the user does not have an internet connection ?
Thank you

Answer: 
As I understood you use [assume-role](https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html), you get a set of credentials like below

```
    {
        "AssumedRoleUser": {
            "AssumedRoleId": "AROA3XFRBF535PLBIFPI4:s3-access-example",
            "Arn": "arn:aws:sts::123456789012:assumed-role/xaccounts3access/s3-access-example"
        },
        "Credentials": {
            "SecretAccessKey": "9drTJvcXLB89EXAMPLELB8923FB892xMFI",
            "SessionToken": "AQoXdzELDDY//////////wEaoAK1wvxJY12r2IrDFT2IvAzTCn3zHoZ7YNtpiQLF0MqZye/qwjzP2iEXAMPLEbw/m3hsj8VBTkPORGvr9jM5sgP+w9IZWZnU+LWhmg+a5fDi2oTGUYcdg9uexQ4mtCHIHfi4citgqZTgco40Yqr4lIlo4V2b2Dyauk0eYFNebHtYlFVgAUj+7Indz3LU0aTWk1WKIjHmmMCIoTkyYp/k7kUG7moeEYKSitwQIi6Gjn+nyzM+PtoA3685ixzv0R7i5rjQi0YE0lf1oeie3bDiNHncmzosRM6SFiPzSvp6h/32xQuZsjcypmwsPSDtTPYcs0+YN/8BRi2/IcrxSpnWEXAMPLEXSDFTAQAM6Dl9zR0tXoybnlrZIwMLlMi1Kcgo5OytwU=",
            "Expiration": "2016-03-15T00:05:07Z",
            "AccessKeyId": "ASIAJEXAMPLEXEG2JICEA"
        }
    }

```

Those credentials you export or use directly while running the command.

1. When you use them directly then you only using the credentials for the specific command, in the next command you are again back to Account A.
2. When you export, you easily call [unset](https://man7.org/linux/man-pages/man1/unset.1p.html) command to unset the exported var you'll be back to Account A and then you call assume-role again and export the credentials for account C.
You don't need to "drop" the assumed role if you're using CLI.

You should use [named profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) and execute commands in different accounts by specifying profile name explicitly with `--profile` CLI switch, or alternatively by changing `AWS_PROFILE` env variable between commands.