Skip to content

Commit 883d275

Browse files
committed
🐛 Current session used in OKTA_ENV_MODE
OKTA_ENV_MODE does not update the current session, but will (unintentionally) make use of the one that is there. This can lead to dangerous confusing situations where the program run is run with the credentials of the current session and not the fresh credentials obtained for OKTA_ENV_MODE. - Suppress current session if OKTA_ENV_MODE is true
1 parent b14e882 commit 883d275

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/com/okta/tools/helpers/SessionHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public SessionHelper(OktaAwsCliEnvironment environment, CookieHelper cookieHelpe
3434
* @throws IOException if file system or permissions errors are encountered
3535
*/
3636
public Optional<Session> getCurrentSession() throws IOException {
37+
if (environment.oktaEnvMode) return Optional.empty();
3738
if (Files.exists(getSessionPath())) {
3839
try (FileReader fileReader = new FileReader(getSessionPath().toFile())) {
3940
Properties properties = new Properties();

0 commit comments

Comments
 (0)