Unknown Error when logging in on iOS app

AI-generated summary

A user, chrismalone, encountered an “Unknown Error” when logging into a Discourse instance via the iOS app, despite being able to log into Meta. The issue was resolved by explicitly including “https://” when adding the site to the app, suggesting a misconfiguration in the forum’s URL handling. j.jaffeux clarified that the app relies on the site.json URL returned by the forum, which should reflect the correct protocol (HTTPS). In this case, the returned URL was HTTP, causing the login failure. chrismalone confirmed the domain was entered as missionmeetup.com without HTTPS. After attempting to fix the configuration locally, chrismalone resolved the issue by forcing HTTPS through Cloudflare settings, confirming it as a viable workaround. j.jaffeux noted that while forcing HTTPS in the app is possible, the correct long-term fix is ensuring the server returns the proper HTTPS URL via site.json. The discussion highlights a potential edge case where forum configurations or reverse proxies (like Cloudflare) may not correctly propagate HTTPS, leading to login failures on the iOS app.

I’m trying to login to a discourse instance on the ios app and get an unknown error. The app seems to be working because I can log into the Meta forum. Any ideas?

I added it again to the app. This time I included https in the link. Then it allowed me to log in. Odd. The app opened the site and the login page without the https but would not actually login.

I though we had a fix for this @j.jaffeux? Maybe the app should be https only to reduce the chance of this error?

I should say that I’m on iOS 11.4 and an up to date version of the native app.

In fact we are already doing this (clarification: we are using the url returned by the forum site.json so if https we should always be correctly using https even if entered via http), I just found and fix an issue at least concerning iOS keeps logging users out when HTTPS site added via HTTP link - #14 by j.jaffeux not sure yet about the OP error. I will make sure it works and make a release and see if it fixes this error too.

@chrismalone can you give me your forum URL? in private if necessary. And also the exact string you are entering when you see the error please.

Yes. It was the raw domain I tried many times. missionmeetup.com

It works as expected if I add https

It sounds like I need to add https to my config. Is that correct?

Yes I think something is wrong in your config. Maybe something with couldflare?

basically we are doing a call to HEAD whatyouenter/user-api-key/new and in the resulting json there’s a url which should be the definitive URL of your forum and with https if correctly configured, for you this URL is returning with http and not https. I could force it to https here for everyone, but I think what we are doing of just using the result of this call is the good solution.

I’ll give a look and see if I can figure it out. I can force https on cloudflare, of course. But I’ll look in my app file to see if I can do it there. I’ll report back.

Thanks for the suggestion. I did try it. It didn’t work, though.

Here’s what I did:
I went into the Cloudflare settings and forced https. That may be a workaround, but it fixed it. Thanks for all the suggestions.