Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after login with authlogic_facebook_connect no redirect #1

Open
picharras opened this issue Jan 17, 2012 · 2 comments
Open

after login with authlogic_facebook_connect no redirect #1

picharras opened this issue Jan 17, 2012 · 2 comments

Comments

@picharras
Copy link

Hi. my app in ruby on rails 3.1.3 after login with authlogic_facebook_connect no redirect to root_url. My button code is:
<%= authlogic_facebook_login_button( "Facebook",:controller=>"user_sessions").html_safe %>
No make the login by post with 'user_sessions'. stay in form login.

My code of form login is:

<%= form_for(@user_session) do |f| %>
<h1>Accede</h1>
<% if @user_session.errors.any? %>
<div id="error_explanation">
  <h2><%= pluralize(@user_session.errors.count, "error") %>. Corrige los siguiente:</h2>
  <ul>
  <% @user_session.errors.full_messages.each do |msg| %>
    <li><%= msg %></li>
  <% end %>
  </ul>
</div>
<% end %>
<p><%= f.text_field :username, :placeholder=>"Correo electrónico" %></p>
<p><%= f.password_field :password,:placeholder=>"Contraseña" %></p>
<p><%= f.check_box :remember_me %> <%= f.label "Recordarme" %></p>
    <p><%= f.submit "Iniciar" %></p>
  <div style="clear:both;"></div></p>
<p>O accede instantaneamente con: <%= authlogic_facebook_login_button("Facebook",:controller=>"user_sessions").html_safe%> <a href="#"><img src="/assets/twitter.png" alt="" /></a></p>
<% end %>

I have my app of facebook created and app_id, secret, api_key. Nor do I see the new application in my facebook

@picharras
Copy link
Author

solved, the problem was the form of facebook is within the normal form. A form into another.

@picharras
Copy link
Author

Now, the problem is:

Started POST "/user_sessions" for ::ffff:187.155.37.77 at Tue Jan 17 04:15:08 +0000 2012
Processing by UserSessionsController#create as HTML
Parameters: {"authenticity_token"=>"THE TOKEN JAJAJAJA"}
Completed 500 Internal Server Error in 1497ms

NoMethodError (undefined method `on' for #<Authlogic::Session::Validation::Errors:0x4093d60>):
app/controllers/user_sessions_controller.rb:22:in `create'
app/controllers/user_sessions_controller.rb:21:in `create'

My method create on user_sessions is:

def create
    @user_session = UserSession.new(params[:user_session])

    respond_to do |format|
      if @user_session.save
         format.html { redirect_to(:users, :notice => 'User session was successfully created.') }
         format.xml  { render :xml => @user_session, :status => :created, :location => @user_session }
      else
         format.html { render :action => "new" }
         format.xml  { render :xml => @user_session.errors, :status => :unprocessable_entity }
    end
  end
 end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant