issues icon indicating copy to clipboard operation
issues copied to clipboard

[Bookworm] Android shortcuts to homescreen or pinned tabs are redirected to the user portal

Open nicofrand opened this issue 1 year ago • 11 comments

Describe the bug

There are two cases where this happens:

  1. I have a shortcut on my android's homescreen to sub.domain.tld (managed by my yunohost, as well as domain.tld).
  2. I have a pinned tab to sub.domain.tld in my browser

Sometimes I need to authenticate, which is normal. Once authenticated I am redirected to domain.tld/sso/portal (or something like that) whereas I want to stay (or go back to) on sub.domain.tld. This is particularly important for webapps.

I then need to click on the app (in the user portal) I initially wanted, which is annoying.

This was not happening before Yunohost 12.

Context

  • Hardware: VPS bought online
  • YunoHost version: 12.0.7
  • I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

To reproduce

Pin a tab, or add a shortcut to your homescreen, from a subdomain belonging to your Yunohost. Then wait for your session to expire, launch this shortcut/tab and authenticate.

Expected behavior

To remain on the URL I went to in the first place (before authentication).

Logs

I don't know what logs I should provide?

nicofrand avatar Dec 03 '24 08:12 nicofrand

duplicate of #2474

OniriCorpe avatar Dec 03 '24 20:12 OniriCorpe

@OniriCorpe #2474 is different. Here, my main domain is hosted on the same server.

nicofrand avatar Dec 04 '24 06:12 nicofrand

In /etc/ssowat/config.json:

{
    [...]
    "domain_portal_urls": {
        "annonces.domain.tld": "domain.tld/yunohost/sso",
        "blog.domain.tld": "domain.tld/yunohost/sso",
        "cal.domain.tld": "domain.tld/yunohost/sso",
        "code.domain.tld": "domain.tld/yunohost/sso",
        "cv.domain.tld": "domain.tld/yunohost/sso",
        "default": "/yunohost/admin",
        "demo.domain.tld": "domain.tld/yunohost/sso",
        "k.domain.tld": "domain.tld/yunohost/sso",
        "mail.domain.tld": "domain.tld/yunohost/sso",
        "matrix.domain.tld": "domain.tld/yunohost/sso",
        "misc.domain.tld": "domain.tld/yunohost/sso",
        "nc.domain.tld": "domain.tld/yunohost/sso",
        "domain.tld": "domain.tld/yunohost/sso",
        "office.domain.tld": "domain.tld/yunohost/sso",
        "pix.domain.tld": "domain.tld/yunohost/sso",
        "rss.domain.tld": "domain.tld/yunohost/sso",
        "stats.domain.tld": "domain.tld/yunohost/sso",
        "wb.domain.tld": "domain.tld/yunohost/sso"
    },
    [...]
}

nicofrand avatar Dec 04 '24 09:12 nicofrand

Editing /etc/ssowat/conf.persistent.json by copying the domain_portal_urls to use the subdomain instead of root domain fixes the issue. But I don't think I should do it manually.

Maybe the info can help solve the issue though?

nicofrand avatar Dec 10 '24 13:12 nicofrand

My previous answer is actually not the solution: while it seems to solve the issue when logged out, it breaks the behaviour when logged: the portal just displays a message saying there are no apps on this domain.

nicofrand avatar Jan 06 '25 08:01 nicofrand

Hello,

I confirm I've the same issue.

Josue-T avatar Jan 06 '25 21:01 Josue-T

I confirm this issue also in android and I have something similar on desktop with searx : https://github.com/YunoHost-Apps/searxng_ynh/issues/363#issuecomment-2591153674

Thatoo avatar Jan 15 '25 08:01 Thatoo

Applying the solution in Use samesite lax for portal cookies YunoHost/yunohost fixes the issue.

Now, it would be great if we did not have to do it manually…

nicofrand avatar Feb 20 '25 08:02 nicofrand

Fixed in https://github.com/YunoHost/yunohost/pull/2018 I think, I'll reopen the issue if needed

nicofrand avatar Feb 25 '25 10:02 nicofrand

I don't understand, it is failing again, and my file still contains the lax attribute…

nicofrand avatar Feb 28 '25 08:02 nicofrand

I am still having the issue… Am I the only one?

What debug data can I provide to help?

nicofrand avatar Aug 20 '25 14:08 nicofrand