Add authorization rule for create user by unsigned user

Add authorization to failed user save path cause it was complaining
that no authorization was performed in that path.
This commit is contained in:
Aditya Prakash 2016-03-24 17:42:00 +05:30
parent dcb98c49f9
commit e851c0b4ff
3 changed files with 3 additions and 1 deletions

View file

@ -34,6 +34,7 @@ class ProposalController < ApplicationController
# If user is not signed in then first create new user and then sign them in
unless current_user
@user = User.new(user_params)
authorize! :create, @user
if @user.save
sign_in(@user)
else