Skip to content

Commit

Permalink
Redirect back to original page after login
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-lerch committed Feb 5, 2025
1 parent 3f8e841 commit 712e394
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/Korga/Controllers/ProfileController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public IActionResult Profile()
}

[HttpGet("~/api/challenge")]
public IActionResult ChallengeLogin()
public IActionResult ChallengeLogin([FromQuery] string redirect)
{
AuthenticationProperties properties = new() { RedirectUri = "/" };
AuthenticationProperties properties = new() { RedirectUri = redirect };
return Challenge(properties, "OAuth");
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/services/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default {
},

async challengeLogin() {
window.location.href = client.baseUrl + "/api/challenge"
//await client.getResponse("/api/challenge")
const params = new URLSearchParams({ redirect: window.location.pathname }).toString()
window.location.href = client.baseUrl + "/api/challenge?" + params
},

async logout() {
Expand Down

0 comments on commit 712e394

Please sign in to comment.