File tree 1 file changed +12
-12
lines changed
com.developer.nefarious.zjoule.plugin/src/com/developer/nefarious/zjoule/plugin/auth 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 19
19
*/
20
20
public abstract class SessionManager {
21
21
22
- /**
23
- * Checks if the user is currently logged in.
24
- * A user is considered logged in if the following memory components are not empty:
25
- * <ul>
26
- * <li>{@link MemoryAccessToken}</li>
27
- * <li>{@link MemoryServiceKey}</li>
28
- * <li>{@link MemoryResourceGroup}</li>
29
- * <li>{@link MemoryDeployment}</li>
30
- * </ul>
31
- *
32
- * @return {@code true} if the user is logged in, {@code false} otherwise.
33
- */
22
+
34
23
public static boolean isUserLoggedIn () {
24
+ return (isSapSessionOn () || isOllamaSessionOn ()) ? true : false ;
25
+ }
26
+
27
+ private static boolean isSapSessionOn () {
35
28
MemoryAccessToken memoryAccessToken = MemoryAccessToken .getInstance ();
36
29
MemoryServiceKey memoryServiceKey = MemoryServiceKey .getInstance ();
37
30
MemoryResourceGroup memoryResourceGroup = MemoryResourceGroup .getInstance ();
@@ -40,6 +33,13 @@ public static boolean isUserLoggedIn() {
40
33
return (memoryAccessToken .isEmpty () || memoryServiceKey .isEmpty () || memoryResourceGroup .isEmpty ()
41
34
|| memoryDeployment .isEmpty ()) ? false : true ;
42
35
}
36
+
37
+ private static boolean isOllamaSessionOn () {
38
+ MemoryOllamaEndpoint memoryOllamaEndpoint = MemoryOllamaEndpoint .getInstance ();
39
+ MemoryOllamaModel memoryOllamaModel = MemoryOllamaModel .getInstance ();
40
+
41
+ return (memoryOllamaEndpoint .isEmpty () || memoryOllamaModel .isEmpty ()) ? false : true ;
42
+ }
43
43
44
44
/**
45
45
* Executes the login process using the specified browser.
You can’t perform that action at this time.
0 commit comments