Skip to content

Commit

Permalink
[auth] encode query in credential offer response
Browse files Browse the repository at this point in the history
  • Loading branch information
patatoid committed Jan 4, 2024
1 parent e490f60 commit 50a64e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="ui center aligned segment">
<h1>Sample credential offer</h1>
<img width="350" src="data:image/svg+xml; base64, <%= qr_code_from_credential_offer(@credential_offer_response) %>" alt="QR code" />
<p><%= text_from_credential_offer(@credential_offer_response) %></p>
<p style="word-break: break-all"><%= text_from_credential_offer(@credential_offer_response) %></p>
</div>
</div>
<div class="credits">
Expand Down
2 changes: 1 addition & 1 deletion apps/boruta_web/lib/boruta_web/views/oauth_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule BorutaWeb.OauthView do
end

def text_from_credential_offer(credential_offer_response) do
"openid-credential-offer://?credential_offer#{credential_offer_response |> Map.from_struct() |> Jason.encode!() |> URI.encode()}"
"openid-credential-offer://?credential_offer=#{credential_offer_response |> Map.from_struct() |> Jason.encode!() |> URI.encode_www_form()}"
end

defimpl Jason.Encoder, for: Boruta.Oauth.TokenResponse do
Expand Down

0 comments on commit 50a64e1

Please sign in to comment.