Skip to content

Commit 011f276

Browse files
author
Arjen
committed
Merge branch 'add-same-device-no-return' into 'main'
Add same_device without return_url flow See merge request wallet/nl-wallet!672
2 parents c70c47c + 3a78f38 commit 011f276

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

wallet_core/mock_relying_party/src/app.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ struct SelectForm {
7676
#[strum(serialize_all = "snake_case")]
7777
enum MrpSessionType {
7878
SameDevice,
79+
SameDeviceNoReturn,
7980
CrossDevice,
80-
Hybrid,
81+
CrossDeviceWithReturn,
8182
}
8283

8384
#[derive(Template)]
@@ -105,7 +106,7 @@ struct EngageUrlparams {
105106
async fn engage(State(state): State<Arc<ApplicationState>>, Form(selected): Form<SelectForm>) -> Result<Response> {
106107
// return URL is just http://public.url/#{session_id}
107108
let return_url_template = match selected.session_type {
108-
MrpSessionType::Hybrid | MrpSessionType::SameDevice => Some(
109+
MrpSessionType::CrossDeviceWithReturn | MrpSessionType::SameDevice => Some(
109110
format!("{}#{{session_id}}", state.public_url)
110111
.parse()
111112
.expect("should always be a valid ReturnUrlTemplate"),
@@ -123,7 +124,7 @@ async fn engage(State(state): State<Arc<ApplicationState>>, Form(selected): Form
123124
.ok_or(anyhow::Error::msg("usecase not found"))?
124125
.clone(),
125126
match selected.session_type {
126-
MrpSessionType::SameDevice => SessionType::SameDevice,
127+
MrpSessionType::SameDevice | MrpSessionType::SameDeviceNoReturn => SessionType::SameDevice,
127128
_ => SessionType::CrossDevice,
128129
},
129130
return_url_template,

wallet_core/mock_relying_party/templates/disclosure.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ <h3><span id="attributes"></span></h3>
9090
<dd>{{ selected.as_ref().unwrap().usecase }}</dd>
9191

9292
<dt>Type</dt>
93-
{% if selected.as_ref().unwrap().session_type == MrpSessionType::SameDevice %}
94-
<dd>same_device</dd>
93+
{% if (selected.as_ref().unwrap().session_type == MrpSessionType::SameDevice) ||
94+
(selected.as_ref().unwrap().session_type == MrpSessionType::SameDeviceNoReturn) %}
95+
<dd>{{ selected.as_ref().unwrap().session_type }}</dd>
9596
</dl>
9697
<a href="{{ urls.0 }}" target="_blank" style="font-size: 2rem;" rel="noopener">
9798
Open NL Wallet

0 commit comments

Comments
 (0)