mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 13:26:05 +10:00
skip verify_authenticity_token
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
class Api::V1::PostsController < ApplicationController
|
||||
|
||||
skip_before_action :verify_authenticity_token
|
||||
before_action :authenticate_user_from_token
|
||||
before_action :permit_params, only: [:create]
|
||||
|
||||
@@ -10,8 +11,8 @@ class Api::V1::PostsController < ApplicationController
|
||||
|
||||
def create
|
||||
post = get_post
|
||||
share_instance = @current_user.share_instances.create sharable: post, description: params[:description]
|
||||
render json: share_instance.to_json(include: :sharable)
|
||||
@share_instance = @current_user.share_instances.create sharable: post, description: params[:description]
|
||||
render json: @share_instance.to_json(include: :sharable)
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Api::V1::RegistrationsController < ApplicationController
|
||||
|
||||
skip_before_action :verify_authenticity_token
|
||||
respond_to :json
|
||||
|
||||
def create
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Api::V1::SessionsController < Devise::SessionsController
|
||||
|
||||
skip_before_action :verify_authenticity_token
|
||||
def create
|
||||
warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failure")
|
||||
render json: user_json
|
||||
|
||||
@@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
|
||||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
# protect_from_forgery with: :exception
|
||||
protect_from_forgery with: :null_session
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
before_action :current_user!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user