summaryrefslogtreecommitdiff
path: root/google-login-plugin/src/com/google/gct/login2/LoginFeature.kt
diff options
context:
space:
mode:
Diffstat (limited to 'google-login-plugin/src/com/google/gct/login2/LoginFeature.kt')
-rw-r--r--google-login-plugin/src/com/google/gct/login2/LoginFeature.kt11
1 files changed, 10 insertions, 1 deletions
diff --git a/google-login-plugin/src/com/google/gct/login2/LoginFeature.kt b/google-login-plugin/src/com/google/gct/login2/LoginFeature.kt
index ed75cc8..60e22ed 100644
--- a/google-login-plugin/src/com/google/gct/login2/LoginFeature.kt
+++ b/google-login-plugin/src/com/google/gct/login2/LoginFeature.kt
@@ -18,6 +18,7 @@ package com.google.gct.login2
import com.google.api.client.auth.oauth2.Credential
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.extensions.ExtensionPointName
+import javax.swing.JComponent
/**
* Extension representing a feature that requires google login with certain [oAuthScopes]. The
@@ -51,7 +52,15 @@ interface LoginFeature {
fun isLoggedIn() = GoogleLoginService.instance.isLoggedIn(this)
- fun logInAsync() = GoogleLoginService.instance.logInAsync(features = setOf(this))
+ fun logInAsync(
+ preferredUser: PreferredUser = PreferredUser.ActiveUser,
+ parentComponent: JComponent? = null,
+ ) =
+ GoogleLoginService.instance.logInAsync(
+ features = setOf(this),
+ preferredUser = preferredUser,
+ parentComponent = parentComponent,
+ )
}
class UserInfoEnforcedFeature : LoginFeature {