Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link component with href should navigate to url as a new connection instead of launch browser and allow for target #1521

Open
bcardarella opened this issue Feb 7, 2025 · 0 comments

Comments

@bcardarella
Copy link
Collaborator

I recall when we made this decision but I don't recall why.

But I now believe we should instead when something like <.link href={~p"/logout"}>Logout</.link> is used we need to actually navigate to a controller to update the cookie. Considering that LVN Core now also supports dead rendering we should just allow for that as well if for whatever reason someone decides to render SwiftUI from a controller. But the primary use case here is to permit session deletion and the expectation is they should then redirect.

This would be in conjunction with #1520 so you'd write the logout link like so:

<.link method="delete" href={~p"/logout"}>Logout</.link>

I do think we should still have a way to spawn a browser, so I believe we should extend the component to support the target attribute from the web. In this case we'd detect something like:

<.link target="_web" href="dockyard.com>DockYard</.link>

Supported values for target

  • _self default - similar to web, this is the same app and is really just a noop as far as what the target does
  • _web - this would do what the current link behavior does
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant