OPENIDE #126 Hide option "Log in via Github"

(cherry picked from commit 9e519d146e3b9c5897276f0c51129f087d8350a4)

(cherry picked from commit ee293f0b7e)
This commit is contained in:
Nikita Iarychenko
2025-03-20 14:37:43 +04:00
parent dbccc37402
commit 63a86e4a42
2 changed files with 16 additions and 11 deletions

View File

@@ -46,7 +46,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
@@ -85,7 +88,6 @@ object GHAccountsUtil {
internal fun createAddAccountActionGroup(model: GHLoginModel, project: Project, parentComponent: JComponent, loginSource: GHLoginSource): ActionGroup {
val group = DefaultActionGroup()
val loginData = GHLoginData(loginSource)
group.add(createBrowserLoginAction(model, project, parentComponent, loginData))
group.add(createTokenLoginAction(model, project, parentComponent, loginData))
group.add(Separator())
@@ -204,14 +206,15 @@ object GHAccountsUtil {
@JvmStatic
@ApiStatus.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)
}
}