(apple) Authentication failure! ActionController::InvalidAuthenticityToken

73 Views Asked by At

I am trying to integrate Sign In with Apple using the omniauth-apple gem and documentation from omniauth requests to use POST in the link but when i do so, i get the following error

(apple) Authentication failure! ActionController::InvalidAuthenticityToken: ActionController::InvalidAuthenticityToken, ActionController::InvalidAuthenticityToken

this is my code

= link_to 'Sign in via Apple', user_apple_omniauth_authorize_path, method: :post

But i do not get this error when I use GET. It works fine.

How do i make it work with POST?

1

There are 1 best solutions below

0
smathy On

Use button_to:

= button_to 'Sign in via Apple', user_apple_omniauth_authorize_path