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