nhosoya / omniauth-apple

OmniAuth strategy for Sign In with Apple
MIT License
260 stars 99 forks source link

Authentication failure! no implicit conversion of String into Array: TypeError, no implicit conversion of String into Array #105

Open AhlOct opened 1 year ago

AhlOct commented 1 year ago

I can successfully authenticate with apple, but then the callback fails with the following error:

(apple) Request phase initiated. Started POST "/api/users/auth/apple/callback" for 114.125.77.150 at 2023-02-17 12:13:04 +0700 Cannot render console from 114.125.77.150! Allowed networks: 127.0.0.0/127.255.255.255, ::1 (apple) Callback phase initiated. (apple) Authentication failure! no implicit conversion of String into Array: TypeError, no implicit conversion of String into Array Processing by Users::OmniauthCallbacksController#failure as HTML Parameters: {"state"=>"59267181a968b7e95a8b940649ea747aee9168b2666c668a", "code"=>"[FILTERED]"}

My controller for omniauth callback like this:

def apple @user = User.from_omniauth(request.env['omniauth.auth']) if @user.persisted? sign_in_and_redirect @user, event: :authentication set_flash_message(:notice, :success, kind: 'apple') if is_navigational_format? else session['devise.apple_data'] = request.env['omniauth.auth'].except(:extra) redirect_to new_user_registation_url end end