The frontend will now be an OAuth app, auto-authorized. The frontend will use an access token for API requests
Adding better errors for the API controllers, posting a simple status works from the frontend now
This commit is contained in:
@ -2,6 +2,14 @@ class ApiController < ApplicationController
|
||||
protect_from_forgery with: :null_session
|
||||
skip_before_action :verify_authenticity_token
|
||||
|
||||
rescue_from ActiveRecord::RecordInvalid do
|
||||
render json: { error: 'Record invalid' }, status: 422
|
||||
end
|
||||
|
||||
rescue_from ActiveRecord::RecordNotFound do
|
||||
render json: { error: 'Record not found' }, status: 404
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def current_resource_owner
|
||||
|
Reference in New Issue
Block a user