How to make a JWT call after login in a plugin

I’m trying to make an SSO login to Thinkific as described here.

EDIT: I flailed a lot. Here’s sort-of how to do it. Real Soon Now I’ll have a plugin.

after_initialize do
  class ::SessionController
    def login(user)
      puts "\n\n\n\LOGIN happening!\n\n\n\n"
      session.delete(ACTIVATE_USER_KEY)
      log_on_user(user)
 
      if payload = cookies.delete(:sso_payload)
        sso_provider(payload)
      else
        # render_serialized(user, UserSerializer)
        sign_into_thinkific(user)
     end
    end
end
2 Likes