Commit 557f6f9
Changed files (2)
app
controllers
scim
app/controllers/scim/v2/users_controller.rb
@@ -1,6 +1,6 @@
module Scim
module V2
- class UsersController < ApplicationController
+ class UsersController < ::Scim::Controller
def create
@user = User.create!(
email: user_params[:userName],
@@ -8,7 +8,7 @@ module Scim
)
response.headers['Content-Type'] = 'application/scim+json'
response.headers['Location'] = scim_v2_users_url(@user)
- render json: @user.to_scim(self), status: :created
+ render json: @user.to_scim(self).to_json, status: :created
end
private
app/controllers/scim/controller.rb
@@ -0,0 +1,5 @@
+module Scim
+ class Controller < ApplicationController
+ protect_from_forgery with: :null_session
+ end
+end