Sha256: a18315efcd6dc2ac1daaa8af54cce9a57bd0e7f1d5984a51a1ad3c913ad08c74

Contents?: true

Size: 903 Bytes

Versions: 15

Compression:

Stored size: 903 Bytes

Contents

class RhoconnectConsole::Server
  post '/login' do
    begin
      session[:errors] = nil      
      session[:login] = params[:login]
      session[:connect] = params[:connect]    
      session[:server_url] = params[:server] 
      session[:server] = params[:connect] == 'direct' ? nil : params[:server]
      
      #verify_presence_of :server, "Server is not provaided."
      verify_presence_of :login, "Login is not provided."
      
      unless session[:errors]         
        session[:token] = RhoconnectApi::get_token(session[:server],params[:login],params[:password])
      end  
    rescue Exception => e
      session[:token] = nil
      report_error("Can't login to Rhoconnect server.")      
      #puts e.message + "\n" + e.backtrace.join("\n")
    end 
    redirect url_path('/'), 303
  end
  
  get '/logout' do
    session[:token] = nil
    redirect url_path('/'), 303
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rhoconnect-3.1.2 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.1.1 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.1.0 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.1.0.beta2 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.1.0.beta1 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.6 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.5 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.4 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.3 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.2 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.1 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.0 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.0.rc1 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.0.beta3 lib/rhoconnect/console/app/routes/auth.rb
rhoconnect-3.0.0.beta1 lib/rhoconnect/console/app/routes/auth.rb