OPENIDE #126 Hide option "Log in via Github"

This commit is contained in:
Nikita Iarychenko
2025-03-20 14:37:43 +04:00
parent 53e8c019d7
commit f247cfaab6
2 changed files with 16 additions and 18 deletions

View File

@@ -59,7 +59,9 @@ object WhiteListUrls {
"https://api.hsforms.com/submissions/v3/integration/submit/",
"https://store.amplicode.ru",
"https://ls.store.amplicode.ru",
"https://resources.openide.ru"
"https://resources.openide.ru",
"https://api.github.com",
"https://avatars.githubusercontent.com"
)
// Collect urls from KnownSchemaIdentifiers.json

View File

@@ -1,4 +1,7 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//
// Modified by Nikita Iarychenko at 2025 as part of the OpenIDE project(https://openide.ru).
// Any modifications are available on the same license terms as the original source code.
package org.jetbrains.plugins.github.authentication
import com.intellij.collaboration.async.cancelledWith
@@ -81,14 +84,6 @@ object GHAccountsUtil {
internal fun createAddAccountActionGroup(model: GHLoginModel, project: Project, parentComponent: JComponent): ActionGroup {
val group = DefaultActionGroup()
group.add(
DumbAwareAction.create(GithubBundle.message("action.Github.Accounts.AddGHAccount.text")) {
scopedDialog(project) {
GHLoginDialog.OAuth(model, project, this, parentComponent).apply {
setServer(GithubServerPath.DEFAULT_HOST, false)
}
}.showAndGet()
})
group.add(
DumbAwareAction.create(GithubBundle.message("action.Github.Accounts.AddGHAccountWithToken.text")) {
@@ -175,14 +170,15 @@ object GHAccountsUtil {
@RequiresEdt
@JvmStatic
internal fun login(model: GHLoginModel, request: GHLoginRequest, project: Project?, parentComponent: Component?) {
if (request.server != GithubServerPath.DEFAULT_SERVER) {
request.loginWithToken(model, project, parentComponent)
}
else when (request.authType) {
AuthorizationType.OAUTH -> request.loginWithOAuth(model, project, parentComponent)
AuthorizationType.TOKEN -> request.loginWithToken(model, project, parentComponent)
AuthorizationType.UNDEFINED -> request.loginWithOAuthOrToken(model, project, parentComponent)
}
//if (request.server != GithubServerPath.DEFAULT_SERVER) {
// request.loginWithToken(model, project, parentComponent)
//}
//else when (request.authType) {
// AuthorizationType.OAUTH -> request.loginWithOAuth(model, project, parentComponent)
// AuthorizationType.TOKEN -> request.loginWithToken(model, project, parentComponent)
// AuthorizationType.UNDEFINED -> request.loginWithOAuthOrToken(model, project, parentComponent)
//}
return request.loginWithToken(model, project, parentComponent)
}
}