refine icon indicating copy to clipboard operation
refine copied to clipboard

[BUG] Improve handling of cancelled GitHub OAuth login (shows 401 instead of user-friendly message)

Open hirdeshds opened this issue 7 months ago • 12 comments

Describe the bug

When a user tries to sign up/login using GitHub OAuth and clicks "Cancel" instead of "Authorize", the application returns a raw error response:

"No user information from OAuth provider" with status 401 Unauthorized.

This is not user-friendly and misleading, as the user intentionally cancelled the login process.

Steps To Reproduce

  1. Go to the signup/login page
  2. Click on "Sign in with GitHub"
  3. On the GitHub authorization screen, click "Cancel"
  4. Observe the error response shown on the screen
Image

Expected behavior

When the user cancels the OAuth flow, the application should detect the error=access_denied parameter and display a user-friendly message such as:

"Login cancelled by user" or "Authorization was denied"

Instead of showing a 401 Unauthorized error.

Image

Packages

(Not sure / can be filled by running npm run refine whoami if required)

Additional Context

The backend seems to assume that OAuth always succeeds and does not handle the cancellation (error=access_denied) case properly.

Handling this case will improve user experience and prevent confusing error messages.

hirdeshds avatar May 03 '26 17:05 hirdeshds

Hi, I’d like to work on this issue

Akkshita06 avatar May 03 '26 18:05 Akkshita06

please assign me this task

hirdeshds avatar May 04 '26 17:05 hirdeshds

Hi 👋 I’d like to work on this issue if it’s still available.

ivanPeshterskii avatar May 07 '26 13:05 ivanPeshterskii

Hey Please Assign Me This Task I Want To Work On it

harshsahu383 avatar May 08 '26 15:05 harshsahu383

Hi I would also like to work on this issue if this problem still persists.

debo-neo avatar May 11 '26 06:05 debo-neo

Hey, I would like to work on this. Please assign if possible.

rahulparihar-30 avatar May 12 '26 15:05 rahulparihar-30

Hey I would love to work on this . Kindly assign this issue to me

Yashmishra06 avatar May 13 '26 09:05 Yashmishra06

Hi, I’d like to work on this.

msodiq19 avatar May 20 '26 08:05 msodiq19

@hirdeshds I dug into this a bit, and it looks like the OAuth failure in the screenshot may be happening in a hosted Refine Cloud / preview flow rather than a local example app. The browser seems to stop at the backend callback URL (cloud2.refine.dev/oauth/github/callback?error=access_denied&...) and return a raw 401 JSON response before it ever gets redirected back to the login page.

I’ve been working on a frontend-side improvement so that if the login page receives error=access_denied, it shows a user-friendly notification instead of a generic auth failure. But based on the screenshot, it seems like there may also be a separate backend-side fix needed here, since the current flow appears to fail before the user returns to the login page.

Can you confirm whether this reproduction is happening in a hosted Refine Cloud / preview environment or in a local example app?

msodiq19 avatar May 20 '26 12:05 msodiq19

Can i work on this issue?

Nexus334023K avatar Jun 12 '26 09:06 Nexus334023K

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 12 '26 01:08 stale[bot]

good

SmitSatasiyaDev avatar Aug 31 '26 11:08 SmitSatasiyaDev