def sso
      require "discourse_mountable_sso/single_sign_on"
      
      sso = DiscourseMountableSso::SingleSignOn.parse(
        ((session[:discourse_mountable_sso] || {}).delete(:query_string).presence || request.query_string),
        @config.secret
      )

      discourse_data = send @config.discourse_data_method
      discourse_data.each_pair {|k,v| sso.send("#{ k }=", v) }

      sso.sso_secret = @config.secret
      yield sso if block_given?
      redirect_to sso.to_url("#{@config.discourse_url}/session/sso_login")
    end
def sso
      require "discourse_mountable_sso/single_sign_on"
      
      sso = DiscourseMountableSso::SingleSignOn.parse(
        ((session[:discourse_mountable_sso] || {}).delete(:query_string).presence || request.query_string),
        @config.secret
      )

      discourse_data = send @config.discourse_data_method
      discourse_data.each_pair {|k,v| sso.send("#{ k }=", v) }

      sso.sso_secret = @config.secret
      yield sso if block_given?
      redirect_to sso.to_url("#{@config.discourse_url}/session/sso_login")
    end
ensures user must login