Skip to content

Commit a053a5f

Browse files
feat: changing mismatching url
1 parent bae013e commit a053a5f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Nullinside.Api.TwitchBot/Controllers/LoginController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,25 @@ public LoginController(INullinsideContext dbContext, IConfiguration configuratio
6262
public async Task<IActionResult> TwitchLogin([FromQuery] string code, [FromServices] ITwitchApiProxy api, CancellationToken token) {
6363
string? siteUrl = _configuration.GetValue<string>("Api:SiteUrl");
6464
if (null == await api.CreateAccessToken(code, token).ConfigureAwait(false)) {
65-
return Redirect($"{siteUrl}/twitch-bot/config?error={TwitchBotLoginErrors.TWITCH_ERROR_WITH_TOKEN}");
65+
return Redirect($"{siteUrl}/twitch/bot/config?error={TwitchBotLoginErrors.TWITCH_ERROR_WITH_TOKEN}");
6666
}
6767

6868
string? email = await api.GetUserEmail(token).ConfigureAwait(false);
6969
if (string.IsNullOrWhiteSpace(email)) {
70-
return Redirect($"{siteUrl}/twitch-bot/config?error={TwitchBotLoginErrors.TWITCH_ACCOUNT_HAS_NO_EMAIL}");
70+
return Redirect($"{siteUrl}/twitch/bot/config?error={TwitchBotLoginErrors.TWITCH_ACCOUNT_HAS_NO_EMAIL}");
7171
}
7272

7373
User? user = await api.GetUser(token).ConfigureAwait(false);
7474
if (string.IsNullOrWhiteSpace(user?.Login) || string.IsNullOrWhiteSpace(user.Id)) {
75-
return Redirect($"{siteUrl}/twitch-bot/config?error={TwitchBotLoginErrors.INTERNAL_ERROR}");
75+
return Redirect($"{siteUrl}/twitch/bot/config?error={TwitchBotLoginErrors.INTERNAL_ERROR}");
7676
}
7777

7878
string? bearerToken = await UserHelpers.GenerateTokenAndSaveToDatabase(_dbContext, email, token, api.OAuth?.AccessToken,
7979
api.OAuth?.RefreshToken, api.OAuth?.ExpiresUtc, user.Login, user.Id).ConfigureAwait(false);
8080
if (string.IsNullOrWhiteSpace(bearerToken)) {
81-
return Redirect($"{siteUrl}/twitch-bot/config?error={TwitchBotLoginErrors.INTERNAL_ERROR}");
81+
return Redirect($"{siteUrl}/twitch/bot/config?error={TwitchBotLoginErrors.INTERNAL_ERROR}");
8282
}
8383

84-
return Redirect($"{siteUrl}/twitch-bot/config?token={bearerToken}");
84+
return Redirect($"{siteUrl}/twitch/bot/config?token={bearerToken}");
8585
}
8686
}

0 commit comments

Comments
 (0)