Sorcery authentication system not working, action not found

68 Views Asked by At

https://github.com/Sorcery/sorcery/wiki/User-Activation

Everytime I click the URL for authenticating the user, I get this error:

AbstractController::ActionNotFound (The action 'activate' could not be found for UsersController)

The action is there:

skip_before_action :require_login, only: [:index, :new, :create, :activate, :login_from_http_basic]
..
private
..
def activate
   if (@user = User.load_from_activation_token(params[:id]))
     @user.activate!
     redirect_to(user_login_path, :notice => 'User was successfully activated.')
   else
     not_authenticated
   end
end

Routes:

  resources :users do
      collection do
      get :login_from_http_basic
    end
    member do
      get :activate
    end
  end

Tried to remove the collection do :login_fro..., didn't help, same errors.

Activation url is: https://example.herokuapp.com/users/#{user.activation_token}/activate

What could be interfering with the activate method not being found?

I tried restarting heroku as well, which usually solves issues where nothing seems to be wrong, but that didn't seem to do anything.

1

There are 1 best solutions below

0
uno On

Looks like because I had it in private it was not able to call on the method since privates can only be called from within the class itself.

DOH