Return to the settings page the user came from after disconnecting
Previously always redirected to /settings (which resolves to /settings/profile). Now reads the Referer header and redirects back to the originating /settings/* page, defaulting to /settings/connections if no valid referer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a181dfe6b8
commit
12371d8c89
1 changed files with 5 additions and 1 deletions
|
|
@ -14,5 +14,9 @@ export async function action({ params, request }: Route.ActionArgs) {
|
|||
// the local row regardless of revoke outcome. Imported activities are
|
||||
// retained (FK is set null on imports.activityId, not cascaded).
|
||||
await unlinkByUserProvider(user.id, manifest.id);
|
||||
return redirect("/settings");
|
||||
|
||||
const referer = request.headers.get("referer");
|
||||
const url = referer ? new URL(referer) : null;
|
||||
const back = url?.pathname.startsWith("/settings") ? url.pathname : "/settings/connections";
|
||||
return redirect(back);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue