How can i access rails sorcery methods in my RESTFULL API File.
desc 'Signin' post "signin_api" do
if @user = User.authenticate(params[:email], params[:password])
@user.set_authentication_token
@current_user = User.find(@user)
status 200
debugger
# login(params[:email], params[:password])
#login_user(@user)
current_user
Although not using Grape, I was running into a similar issue of Sorcery methods not being recognized in a Rails 5.2 api.
Adding
include Sorcery::Controllerto the top of my SessionsController resolved my issue.Example:
Source: Last response in Sorcery issues #47