/_app/ is redirected to SSO login page

Users are reporting that the latest version of FacilMap does not work anymore.

The issue seems to be that the latest version of FacilMap serves its resources (such as JavaScript files) under /_app/. YunoHost seems to forward those URLs to the SSO login page, so the JavaScript files fail to load.

I am the creator of FacilMap, I have very little experience with YunoHost. I had a look at manifest and at the documentation, but I cannot find anything that would explain why the main page works without SSO but the resources under /_app/ don’t. Does anyone have an idea?

This sounds like an nginx issue.
Have a look at the nginx config file here facilmap_ynh/conf/nginx.conf at master · YunoHost-Apps/facilmap_ynh · GitHub
If it can help

It seems like sub paths in general do not work. https://dudenas.lt/maps/_app/ works as intended, whereas YunoHost Portal also redirects to SSO, and https://dudenas.lt/maps/test/gpx for some reason gives an internal server error.

However, I don’t see how the nginx config could be causing that? The location should apply to all sub paths, shouldn’t it?

Ah, the problem seems to be something else. The app embeds the scripts using /_app, so they don’t use the sub path specified for the app.

Can I use https://$domain$path as the base URL, or can YunoHost run on a different port or without HTTPS?

why not using relative links? _app instead of /_app

2 Likes

I will use relative paths now for the resources.

However, there are some situations where absolute URLs are required, specifically the opensearch and oembed manifests.

I had a look whether I can use some of the X-Forwarded-* headers to detect the base URL, but it seems like the original path is not present there.

Some apps on yunohost require a dedicated domain to be installed. Since this issue is only present on paths, why not just removing the option of path in the manifest?

It sounds like that would be pretty annoying for users, particularly for those that already have the app installed under a path. So I would prefer to avoid that.

I remember seeing an app that removed the support for path installation a while ago. I don’t remember which one. I’ve just created a subdomain and moved it there. Yunohost makes installations so easy that it wasn’t that hard to change the app location.
I don’t personally use your app but it got my interest and will check it very soon. But I think that you can see with actual users if this solution is annoying or not.
Good luck and thank you for your contributions