Closed booleanbetrayal closed 2 years ago
Given the rhythm of collaboration here, it might be worth writing a pull-request to add the option?
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
you can define failure callback at OmniAuth.config.on_failure
https://github.com/omniauth/omniauth/blob/a62d36b3f847e0e55b077790112e96950c35085a/lib/omniauth/strategy.rb#L533-L545
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-L83Wondering if this is something this gem should explicitly try to suppress.