Skip to content

Commit 27bdc0b

Browse files
Merge pull request #113 from nullinside-development-group/feat/ws
feat: updating error codes
2 parents dbaa396 + 7d745fb commit 27bdc0b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Nullinside.Api/Controllers/UserController.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ public async Task<RedirectResult> TwitchLogin([FromQuery] string code, [FromServ
147147
/// <returns>
148148
/// A redirect to the nullinside website.
149149
/// Errors:
150-
/// 2 = Internal error generating token.
151-
/// 3 = Code was invalid
152-
/// 4 = Twitch account has no email
150+
/// 1 = Internal error
151+
/// 2 = Error with twitch
153152
/// </returns>
154153
[AllowAnonymous]
155154
[HttpGet]
@@ -160,12 +159,12 @@ public async Task<RedirectResult> TwitchStreamingToolsLogin([FromQuery] string c
160159
// credentials question we're being asked.
161160
string? siteUrl = _configuration.GetValue<string>("Api:SiteUrl");
162161
if (!_webSockets.WebSockets.ContainsKey(state)) {
163-
return Redirect($"{siteUrl}/user/login/desktop?error=2");
162+
return Redirect($"{siteUrl}/user/login/desktop?error=1");
164163
}
165164

166165
// Since someone already warned us this request was coming, create an oauth token from the code we received.
167166
if (null == await api.CreateAccessToken(code, token)) {
168-
return Redirect($"{siteUrl}/user/login/desktop?error=3");
167+
return Redirect($"{siteUrl}/user/login/desktop?error=2");
169168
}
170169

171170
// The "someone" that warned us this request was coming has been sitting around waiting for an answer on a web
@@ -184,7 +183,7 @@ public async Task<RedirectResult> TwitchStreamingToolsLogin([FromQuery] string c
184183
socket.Dispose();
185184
}
186185
catch {
187-
return Redirect($"{siteUrl}/user/login/desktop?error=2");
186+
return Redirect($"{siteUrl}/user/login/desktop?error=1");
188187
}
189188

190189
return Redirect($"{siteUrl}/user/login/desktop");

0 commit comments

Comments
 (0)