401 (Unauthorized) error when trying to log in
Version
0.12.9
Operating System
Linux
Distribution Method
AppImage (Linux)
Describe the issue
When I click login it stuck loading and on devtools it shows 401 error.
It is making requests to https://app.gitbutler.com/api/login/user/2936076de6bc8f035bb2eb2bca51acc4d64d2e4da2dd9cba4be7e1e6dd8d3b16.json
And it send no body and no cookies
How to reproduce
Download AppImage to OpenSUSE TumbleWeed, start and try to log in
Expected behavior
Open a log in window?
Relevant log output
[Error] Failed to load resource: the server responded with a status of 401 (Unauthorized) (07e9214404a7836b226cd5ffb1eb827593be08a63de04490861c74df80556a1b.json, line 0)
Thanks a lot for reporting!
It seems like there is a retry mechanism that never stops.
Can you confirm that all you did is click the "Log in or Sign up" button? Or did it actually redirect you after dealing with the browser's authentication flow?
https://github.com/user-attachments/assets/f269a3cd-88d4-4959-887f-f4cdbbb0c9af
Can you confirm that all you did is click the "Log in or Sign up" button?
Yes, I did. Here is the video
Thanks a lot, that helps!
What follows might be the responsible code, so it should end after ~120s. Errors are ignored and that sounds about like what's happening here.
https://github.com/gitbutlerapp/gitbutler/blob/28d72ae5c09248bf9b3bd351ad0e70f01f683a77/app/src/lib/stores/user.ts#L92-L102
CC @mtsgrd
I tried on flatpak and it is working fine. Previously I have fixed this issue, by changing SSL certificates. It might be the problem.
And I suppose that the login/user/${token}.json endpoint does not have authentication, yet the server is returning 401 error. Can you please check the server code?
Actually, I can't, but CC @krlvi who could if it makes sense.
It's great to know that flatpack works, which means the app-image might have other restrictions, possibly even 'locally' due to app sandboxing.