I'm using Devise with lockable as login system in my application. It works fine with server generated pages.
Now i am creating single page application endpoint with AngularJS (REST API). Login works fine but when I do fail to login then failed_attempts doesn't increment and lockable doesn't work.
What should I do to enable lockable support in my logging in via REST API.
My action (REST API)
def login
user = UserService.get_user_by_email params[:login]
if UserService.user_password_is_valid? user, params[:password]
sign_in :user, user
render_json({
success: true
})
else
render_json({
success: false
})
end
end
How can i make lockable work with REST Api?