Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user_cancelled_authorize: OmniAuth::Strategies::OAuth2::CallbackError, user_cancelled_authorize #23

Closed
booleanbetrayal opened this issue Apr 30, 2020 · 3 comments

Comments

@booleanbetrayal
Copy link

Seems that this gem results in a OmniAuth::Strategies::OAuth2::CallbackError being raised when the user cancels the Sign in with Apple flow, after supplying their credentials, when presented with the Cancel / Continue buttons.

Here appears to be some relevant code in omniauth-oauth2: https://github.com/omniauth/omniauth-oauth2/blob/master/lib/omniauth/strategies/oauth2.rb#L66-L83

Wondering if this is something this gem should explicitly try to suppress.

@skotchpine
Copy link

Given the rhythm of collaboration here, it might be worth writing a pull-request to add the option?

@dreucodi
Copy link

For those looking for quick-and-dirty handling of this error:

Rails.application.config.to_prepare do
  OmniAuth::Strategies::Apple.class_eval do
    # Patched to handle user cancel event
    def callback_call
      if request.params["error"] == "user_cancelled_authorize"
        return redirect whatever_url
      end

      super
    end
  end
end

@nov
Copy link
Collaborator

nov commented Sep 27, 2022

you can define failure callback at OmniAuth.config.on_failure
https://github.com/omniauth/omniauth/blob/a62d36b3f847e0e55b077790112e96950c35085a/lib/omniauth/strategy.rb#L533-L545

@nov nov closed this as completed Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants