Hi everyone,
I have developed a login form that allow users to login using their
gmail account. Enabling users to login using their gmail account I use
XMPP4R library which is written in ruby. When users provide correct
userid and password then i redirect them to home page, otherwise i
redirect them to login page again. Rails does not redirect users to
anywhere, but it display a link says "You are being redirect.". If
users
click the link it will bring users to the destination. Below is my code:
require ''xmpp4r/client''
include Jabber
class LoginController < ApplicationController
def index
end
def whollycity_authen
login = params[:login]
username = JID::new(login[:username] + "@" + login[:server] +
".com")
password = login[:password]
user = Client::new(username)
begin
user.connect
user.auth(password)
redirect_to :controller => "home"
rescue
redirect_to :controller => "login"
end
end
end
can anyone help?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---