From 0ad283e590d0e708c65d002af1e010c8aa4a8ca4 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Tue, 14 Jul 2026 03:01:41 +0200 Subject: [PATCH] fix(magic-link): correct url to fit sveltekit --- src/application/services/magic_link_invite_service.rs | 3 ++- src/interfaces/api/handlers/magic_link_handler.rs | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/application/services/magic_link_invite_service.rs b/src/application/services/magic_link_invite_service.rs index aad94bd6..7f272350 100644 --- a/src/application/services/magic_link_invite_service.rs +++ b/src/application/services/magic_link_invite_service.rs @@ -449,7 +449,8 @@ impl MagicLinkInviteService { /// is reserved for `resolve_or_create_recipient` — and if the /// matched user has no other login credential, mint a NULL-resource /// magic-link token and email a sign-in link. The redemption - /// endpoint lands a NULL-resource token on `/#/sharedwithme`. + /// endpoint lands a NULL-resource token on `/shared-with-me` + /// (external users) or `/files` (internal users). /// /// Always returns `Ok(())` so the caller can emit a uniform /// response shape (`"If an account exists, a link will be sent."`) diff --git a/src/interfaces/api/handlers/magic_link_handler.rs b/src/interfaces/api/handlers/magic_link_handler.rs index fd1f42c4..3c2738af 100644 --- a/src/interfaces/api/handlers/magic_link_handler.rs +++ b/src/interfaces/api/handlers/magic_link_handler.rs @@ -8,10 +8,10 @@ //! 2. Issues access + refresh JWT for the token's owning user. //! 3. Sets the standard `oxicloud_access` / `oxicloud_refresh` / //! `oxicloud_csrf` cookies (same as `POST /api/auth/login`). -//! 4. 302-redirects to a frontend hash-route based on the token's -//! resource target: -//! - Folder → `/#/files/folder/{id}` -//! - File or NULL → `/#/sharedwithme` +//! 4. 302-redirects to a SPA route based on the token's resource +//! target: +//! - Folder → `/files/{id}` +//! - File or NULL → `/shared-with-me` //! //! Files don't have a deep-link route today; v1 lands file invitations //! on Shared With Me where the file shows up. @@ -140,7 +140,7 @@ struct RedeemQuery { params(("token" = String, Path, description = "Opaque magic-link token")), responses( (status = 200, description = "Cross-browser confirmation prompt (HTML page)"), - (status = 302, description = "Redemption succeeded — redirects to the resource or to /#/sharedwithme"), + (status = 302, description = "Redemption succeeded — redirects to the resource or to /shared-with-me"), (status = 410, description = "Token is unknown, expired, or already used"), (status = 503, description = "Magic-link feature is not configured on this server"), ),