woheller69 / gptAssist

gptAssist is a simple WebView wrapper for ChatGPT
GNU General Public License v3.0
226 stars 6 forks source link

Login needed each time the app is opened #2

Closed JoshuaKimsey closed 1 year ago

JoshuaKimsey commented 1 year ago

I noticed that the user has to login each time the app is opened, if it doesn't stay open in the background.

It would be nice if the login can be preserved in order to avoid needing to login each time, if this is possible with the way the app has been implemented.

woheller69 commented 1 year ago

on my devices I do not have this issue...

sinanSEsinan commented 1 year ago

I have the same issue, MIUI Global 14.0.1

woheller69 commented 1 year ago

If someone knows a fix let me know. I am running the app on several devices and none has this issue...

Kurasami commented 1 year ago

Yeah this is happening to me too. Using Xiaomi 13 Ultra. I need to log in every single time and with TOTP turned on, it's a pretty annoying process.

I found these as a starting resource in attempting to fix the issue:

  1. https://stackoverflow.com/questions/22010474/android-webview-keep-user-logged-in
  2. https://stackoverflow.com/questions/41977295/keep-user-logged-in-when-using-a-android-webviewclient
  3. https://stackoverflow.com/questions/48195419/can-we-save-login-data-in-android-webview

Seems there's a couple of ways to ensure that login data is saved.

Android: 13 MIUI: 14.0.15

Kurasami commented 1 year ago

Edit: Same problem on OnePlus 10 Pro Android 13.

Could it be related to disabling AI/Training etc. in the chatGPT settings?

At least it seems Xiaomi & OnePlus devices are affected now.

woheller69 commented 1 year ago

no idea. Do you get something like "Your session has expired?" I get that sometimes after a few days.

Kurasami commented 1 year ago

Nope. It just asks us to login again. I literally just swipe the app away and boom, logged out.

You could try one of the methods on the Stackoverflow page.

woheller69 commented 1 year ago

Maybe you have a strange webview installed on your system? Can you check your webview installation? Is it the "normal" Android System WebView from Google or something else like Bromite Webview?

Kurasami commented 1 year ago

It's the plain old Android System Webview.

Screenshot_2023-06-08-06-12-44-291_com android vending-edit

You can ignore that it's the beta. My wife isn't in the beta and she gets logged out on her phone too when she closes the app.

My version is: 115.0.5790.21 Her's: 114.0.5735.60

woheller69 commented 1 year ago

Can you try this? I added a flush() for CookieManager in onPause(). Maybe that helps. I also added a toast "No cookies available" if cookies got deleted. Do you get that every time?

-Uninstall -Remove .zip -Install

Test version1: app-release.apk.zip

woheller69 commented 1 year ago

And here is another test version that allows third party cookies.

Test version 2: app-release.apk.zip

SomeDeveloping commented 1 year ago

Hello, tried both test versions and they work fine now. I'll keep the first version. (MIUI 14 with Bromite Webview)

woheller69 commented 1 year ago

@Kurasami Does Test version 1 also work for you and your wife?

Kurasami commented 1 year ago

Can you try this? I added a flush() for CookieManager in onPause(). Maybe that helps. I also added a toast "No cookies available" if cookies got deleted. Do you get that every time?

-Uninstall -Remove .zip -Install

Test version1: app-release.apk.zip

Works for both of us 100% dude. You rock! Swiping off and even force killing the app and I am still logged in.

Now if you could just give us the option to remove the top proxy banner that would be great 👍 but good on you for working on that ticket too.

P.S. Sending some money your way. Thanks for fixing this so fast dude! You rock. I've used other apps but they all bundle with a bunch of other nonsense and essentially what anyone needs is just a low-overhead PWA like this to use the site. This is fantastic. HUGE thanks!

woheller69 commented 1 year ago

Will make a new release next week without the proxy stuff.

No idea if that works, I don't use proxies...

woheller69 commented 1 year ago

Here is an apk without proxy banner https://github.com/woheller69/gptAssist/suites/13528316041/artifacts/743824055

will be soon on F-Droid

825i commented 1 year ago

Is this still coming to F-Droid sometime? I see new releases but they are not on F-Droid.

woheller69 commented 1 year ago

V1.6 is on F-Droid

https://f-droid.org/de/packages/org.woheller69.gptassist/

If you have the test version above you need to uninstall first, due to different signing key