title: Invalid Authenticity Token on Post
body: <p>I am using <code>devise</code> to sign up/in.</p>
  
  <p><strong>routes</strong></p>
  
  <pre><code>get 'profile' =&gt; 'profile#get_profile'
  post 'profile' =&gt; 'profile#create_profile'
  </code></pre>
  
  <p>and <strong>profile_controller</strong></p>
  
  <pre><code>def get_profile
      render json: {user: current_user}, status: :ok
  end
  
  def create_profile
      render json: {user: current_user}, status: :ok
  end
  </code></pre>
  
  <p><strong>GET:</strong> <a href="http://localhost:3000/user/profile" rel="noreferrer">http://localhost:3000/user/profile</a> returns the expected output. However,</p>
  
  <p><strong>POST</strong> request throws an error saying:</p>
  
  <p><code>ActionController::InvalidAuthenticityToken in  User::ProfileController#create_profile</code>.</p>
  
  <p>Please demystify this behavior.</p>