You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scott Robertson edited this page Jan 17, 2021
·
1 revision
If you have a custom auth system, you can simply create your own Auth Strategy, and Tokenable will use it.
All you need to do is add something similar to your User model.
# The params are passed directly from a controller, so you can do anything with# them that you normally would within a controller.defself.from_tokenable_params(params)user=User.find_by(something: params[:something])returnnilunlessuser.present?returnnilunlessuser.password_valid?(params[:password])userend