Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/Nullinside.Api/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ public async Task<RedirectResult> TwitchLogin([FromQuery] string code, [FromServ
/// <returns>
/// A redirect to the nullinside website.
/// Errors:
/// 2 = Internal error generating token.
/// 3 = Code was invalid
/// 4 = Twitch account has no email
/// 1 = Internal error
/// 2 = Error with twitch
/// </returns>
[AllowAnonymous]
[HttpGet]
Expand All @@ -160,12 +159,12 @@ public async Task<RedirectResult> TwitchStreamingToolsLogin([FromQuery] string c
// credentials question we're being asked.
string? siteUrl = _configuration.GetValue<string>("Api:SiteUrl");
if (!_webSockets.WebSockets.ContainsKey(state)) {
return Redirect($"{siteUrl}/user/login/desktop?error=2");
return Redirect($"{siteUrl}/user/login/desktop?error=1");
}

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

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

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