Sha256: 8b03c94fc987e888dde05fed65cf6ebf66d38b0569ddeaede404714115918306

Contents?: true

Size: 894 Bytes

Versions: 21

Compression:

Stored size: 894 Bytes

Contents

class RhosyncConsole::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] = RhosyncApi::get_token(session[:server],params[:login],params[:password])
      end  
    rescue Exception => e
      session[:token] = nil
      report_error("Can't login to Rhosync 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

21 entries across 21 versions & 1 rubygems

Version Path
rhosync-2.1.18.beta2 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.18.beta1 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta7 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta6 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta5 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta4 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta3 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta2 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.17.beta1 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.16 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.15 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.14 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.13 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.12 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.11 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.10 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.7 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.6 lib/rhosync/console/app/routes/auth.rb
rhosync-2.1.3 lib/rhosync/console/app/routes/auth.rb