Twistag / jetbrains-refraction

Jetbrains Plugin for Refraction
https://www.refraction.dev/extensions/jetbrains
MIT License
0 stars 0 forks source link

"User not authenticated" error #3

Open haydenbleasel opened 1 year ago

haydenbleasel commented 1 year ago

Feedback from Intercom:

Hello, I'm using Android Studio (based on Jetbrains), but after putting my UserId, when I try to do a Refraction action, e.g. Detect bug, I get an error message: "User is not authenticated". How can I solve this? Thank you in advance for your help.

PS: I obviously tried to restart the program

I'll try to replicate on Android Studio first.

haydenbleasel commented 1 year ago

Update: this is because we're throwing a custom error message rather than what's being returned from the API:

https://github.com/beskar-co/jetbrains-refraction/blob/978413d43ceb3c24cec122e578431a257d1b9038/src/main/java/com/refraction/plugin/intellijrefraction/actions/AbstractRefractionAction.java#L36

toptaltkech17 commented 1 year ago

Hmm, I looked at it, I installed android studio and could not replicate it. I even tried adding some spaces to the user id if it would make the id invalid but it was still valid.

what we could do is to update the source code and version:

if (is2xx(httpResponse.statusCode())) { ----callApiToGenerateCode(event, codeAndLanguage); } else if (HttpStatus.SC_NOT_FOUND == httpResponse.statusCode()){ ----NotificationService.showWarningNotification("User is not authenticated"); } else { ----NotificationService.showWarningNotification("Couls not authenticate: " + httpResponse.body()); }

@haydenbleasel

Please confirm it and will make changes

toptaltkech17 commented 1 year ago

https://github.com/beskar-co/jetbrains-refraction/pull/4

@haydenbleasel Here is the pull request.