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?