3

I am using the AuthLogic gem in my ruby app (not rails). this gem can manage multiple sessions for same user, but, if i want to block a user from my app, i want to invalidate all his sessions from backend. currently i can destroy the session only when its active

 user_session = UserSession.find
  if user_session
    user_session.destroy
    return {status: 200, message: 'Success'}
  else
    return {status: 400, message: 'No session to destroy'}
  end

, but how can i get all user sessions by user id and destroy them?

Dima
  • 8,586
  • 4
  • 28
  • 57

0 Answers0