Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 484cd81

Browse files
Remove regex processing of special error cases
1 parent 1bc5aeb commit 484cd81

File tree

6 files changed

+5
-25
lines changed

6 files changed

+5
-25
lines changed

octorun/src/authentication.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ var endOfLine = require('os').EOL;
22
var config = require("./configuration");
33
var octokitWrapper = require("./octokit");
44

5-
var lockedRegex = new RegExp("number of login attempts exceeded", "gi");
65
var twoFactorRegex = new RegExp("must specify two-factor authentication otp code", "gi");
7-
var badCredentialsRegex = new RegExp("bad credentials", "gi");
86

97
var scopes = ["user", "repo", "gist", "write:public_key"];
108

@@ -48,12 +46,6 @@ var handleAuthentication = function (username, password, onSuccess, onFailure, t
4846
else if (twoFactorRegex.test(err.message)) {
4947
onSuccess(password, "2fa");
5048
}
51-
else if (lockedRegex.test(err.message)) {
52-
onFailure("locked")
53-
}
54-
else if (badCredentialsRegex.test(err.message)) {
55-
onFailure("badcredentials")
56-
}
5749
else {
5850
onFailure(err)
5951
}

octorun/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8bc23505
1+
196e9867

src/GitHub.Api/Authentication/LoginManager.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,9 @@ private async Task<LoginResultData> TryLogin(
193193
return new LoginResultData(resultCodes, message, host, ret.Output[0]);
194194
}
195195

196-
if (ret.IsBadCredentials)
197-
{
198-
return new LoginResultData(LoginResultCodes.Failed, "Bad credentials.", host, ret.Output[0]);
199-
}
200-
201-
if (ret.IsLocked)
202-
{
203-
return new LoginResultData(LoginResultCodes.LockedOut, "Account locked.", host, ret.Output[0]);
204-
}
205-
206196
if (ret.Output.Any())
207197
{
208-
return new LoginResultData(LoginResultCodes.Failed, "Failed.", host, ret.Output[0]);
198+
return new LoginResultData(LoginResultCodes.Failed, ret.Output[0], host);
209199
}
210200

211201
return new LoginResultData(LoginResultCodes.Failed, "Failed.", host);

src/GitHub.Api/Installer/OctorunInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class OctorunInstallDetails
102102
public const string DefaultZipMd5Url = "https://ghfvs-installer.github.com/unity/octorun/octorun.zip.md5";
103103
public const string DefaultZipUrl = "https://ghfvs-installer.github.com/unity/octorun/octorun.zip";
104104

105-
public const string PackageVersion = "8bc23505";
105+
public const string PackageVersion = "196e9867";
106106
private const string PackageName = "octorun";
107107
private const string zipFile = "octorun.zip";
108108

src/GitHub.Api/Resources/octorun.zip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:c56b2f70a9449004489117844e6894a4541001ed20a6fb63bfc9aeacfd419010
3-
size 211930
2+
oid sha256:b88a832fae41b944798323b91a745909bbf7d083fdf2455e2ec71dd51030523a
3+
size 211853

src/GitHub.Api/Tasks/OctorunTask.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,5 @@ public OctorunResult(string status, string[] output)
132132
public bool IsSuccess => Status.Equals("success", StringComparison.InvariantCultureIgnoreCase);
133133
public bool IsError => Status.Equals("error", StringComparison.InvariantCultureIgnoreCase);
134134
public bool IsTwoFactorRequired => Status.Equals("2fa", StringComparison.InvariantCultureIgnoreCase);
135-
public bool IsLocked => Output.First().Equals("locked", StringComparison.InvariantCultureIgnoreCase);
136-
public bool IsBadCredentials => Output.First().Equals("badcredentials", StringComparison.InvariantCultureIgnoreCase);
137135
}
138136
}

0 commit comments

Comments
 (0)