mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-135118 github: trim token string
This commit is contained in:
@@ -267,7 +267,7 @@ public class GithubSettingsPanel {
|
||||
}
|
||||
Object selected = myAuthTypeComboBox.getSelectedItem();
|
||||
if (AUTH_PASSWORD.equals(selected)) return GithubAuthData.createBasicAuth(getHost(), getLogin(), getPassword());
|
||||
if (AUTH_TOKEN.equals(selected)) return GithubAuthData.createTokenAuth(getHost(), getPassword());
|
||||
if (AUTH_TOKEN.equals(selected)) return GithubAuthData.createTokenAuth(getHost(), StringUtil.trim(getPassword()));
|
||||
LOG.error("GithubSettingsPanel: illegal selection: anonymous AuthData created", selected.toString());
|
||||
return GithubAuthData.createAnonymous(getHost());
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.github.util;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.github.api.GithubApiUtil;
|
||||
@@ -151,7 +152,7 @@ public class GithubAuthData {
|
||||
@NotNull private final String myToken;
|
||||
|
||||
private TokenAuth(@NotNull String token) {
|
||||
myToken = token;
|
||||
myToken = StringUtil.trim(token);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user