···272 return contextual_error!(web_context, language, error_template, default_context, err);
273 }
274275+ // Store destination if provided and not "/"
276+ if let Some(ref dest) = destination.destination {
277+ if dest != "/" {
278+ // Create a direct instance to access the set_destination method
279+ let postgres_storage = crate::storage::atproto::PostgresOAuthRequestStorage::new(
280+ web_context.pool.clone()
281+ );
282+ if let Err(err) = postgres_storage.set_destination(&oauth_request_state.state, dest).await {
283+ tracing::error!(?err, "set_destination");
284+ // Don't fail the login flow if we can't store the destination
285+ }
286+ }
287+ }
288+289 let oauth_args = [
290 (
291 "request_uri".to_string(),
+4
src/http/handle_view_event.rs
···283284 let event_url = url_from_aturi(&ctx.web_context.config.external_base, &event.aturi)?;
285000286 // Add Edit button link if the user is the event creator
287 let can_edit = ctx
288 .current_handle
···464 language => ctx.language.to_string(),
465 identity_has_email,
466 canonical_url => event_url,
0467 event => event_with_counts,
468 is_self,
469 can_edit,
···283284 let event_url = url_from_aturi(&ctx.web_context.config.external_base, &event.aturi)?;
285286+ // Create login URL with destination parameter for this event
287+ let login_url = format!("/oauth/login?destination={}", urlencoding::encode(&format!("/{}/{}", handle_slug, event_rkey)));
288+289 // Add Edit button link if the user is the event creator
290 let can_edit = ctx
291 .current_handle
···467 language => ctx.language.to_string(),
468 identity_has_email,
469 canonical_url => event_url,
470+ login_url => login_url,
471 event => event_with_counts,
472 is_self,
473 can_edit,