Skip to content

Commit e04481f

Browse files
authored
Use Desktop deep-link for enrolment (#2122)
1 parent 439dd3b commit e04481f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

crates/defguard_mail/src/templates.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ pub async fn new_account_mail(
221221
context.insert("url", &enrollment_service_url);
222222
context.insert("token", enrollment_token);
223223

224-
// prepare enrollment service URL
224+
// Build URL to Proxy's "open desktop" page, with token as query.
225+
if let Ok(mut url) = enrollment_service_url.path_segments_mut() {
226+
url.push("open-desktop");
227+
}
225228
enrollment_service_url
226229
.query_pairs_mut()
227230
.append_pair("token", enrollment_token);

crates/defguard_mail/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn send_new_account(_: PgPoolOptions, options: PgConnectOptions) {
128128
set_smtp_settings(&pool).await;
129129

130130
let mut conn = pool.begin().await.unwrap();
131-
let url = Url::parse("http://localhost:8000").unwrap();
131+
let url = Url::parse("http://localhost:8001").unwrap();
132132
let context = Context::new();
133133
let token = "zXc6N1ndXpWFeyBuogiFp1bD1UomAbZc";
134134
new_account_mail(

0 commit comments

Comments
 (0)