Skip to content

Commit

Permalink
Fix backend fake authentication (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegRakovich authored May 16, 2023
1 parent 9f31796 commit f617c98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/backend/Server.Users.Fake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
app.MapPost("/login", (HttpContext context) =>
{
var request = ToLoginRequest(context.Request.Form);
var code = $"{request.user}:{request.redirect_uri}".ToBase64();
var code = $"{request.user}!{request.redirect_uri}".ToBase64();
var redirectToUrl = $"{request.redirect_uri}?code={code}";
return Results.Redirect(redirectToUrl);
});
Expand All @@ -41,7 +41,7 @@
if (request.client_id != "fake") return InvalidClientId();

var code = request.code.FromBase64();
var parts = code.Split(':');
var parts = code.Split('!');
var (user, redirect_uri) = (parts[0], parts[1]);
if (request.redirect_uri != redirect_uri) return InvalidRequestUri(request, redirect_uri);

Expand Down

0 comments on commit f617c98

Please sign in to comment.