Skip to content

Commit df1c0be

Browse files
author
Arjen
committed
Merge branch 'fix-disclosed-attributes-url' into 'main'
Fix relative disclosed attributes url See merge request wallet/nl-wallet!568
2 parents efe1823 + 3680eba commit df1c0be

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

wallet_core/mock_relying_party/src/app.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ async fn engage(State(state): State<Arc<ApplicationState>>, Form(selected): Form
131131
.await?;
132132

133133
// the mrp disclosed attributes url matches the wallet server disclosed attributes url
134-
let mut mrp_disclosed_attributes_url: Url = state.public_url.clone();
135-
mrp_disclosed_attributes_url.set_path(disclosed_attributes_url.path());
134+
let mrp_disclosed_attributes_url: Url = state
135+
.public_url
136+
.join(disclosed_attributes_url.path())
137+
.expect("should always be a valid url");
136138

137139
Ok(askama_axum::into_response(&DisclosureTemplate {
138140
engagement: Some((

wallet_core/mock_relying_party/templates/disclosure.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
let disclosedAttributesUrl;
4444
if (window.location.hash) {
4545
let sessionId = window.location.hash.substring(1)
46-
disclosedAttributesUrl = `/sessions/${sessionId}/disclosed_attributes`
46+
let publicUrl = [window.location.protocol, '//', window.location.host, window.location.pathname].join('');
47+
disclosedAttributesUrl = `${publicUrl}/sessions/${sessionId}/disclosed_attributes`
4748
if (window.location.search.startsWith("?transcript_hash=")) {
4849
let end = window.location.search.search("&")
4950
end = end == -1 ? window.location.search.length : end

0 commit comments

Comments
 (0)