Code Monkey home page Code Monkey logo

Comments (12)

mmangino avatar mmangino commented on August 16, 2024

What are you storing? Once you use the oauth code to get a facebook session, you need to store the session info and discard the token.

Mike

On Dec 10, 2012, at 4:12 AM, derri [email protected] wrote:

Hi All

I can login using facebooker2, and on my home page I use current_facebook_user but I get error "This authorization code has been used." Mogli::Client::OAuthException.

a few month ago it doesn't happen.

any body can help me?


Reply to this email directly or view it on GitHub.

from facebooker2.

menan avatar menan commented on August 16, 2024

Hey Mike, This is the same error I am getting. I think it's because Facebook changed some stuff recently. This is my stack trace that I posted on Mogli.


/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:79:in `raise_error_by_type_and_message'
/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:70:in `raise_client_exception'
/Users/alexandrecarriere/.bundler/ruby/1.8/mogli-b8f68b5d7e44/lib/mogli/client.rb:52:in `create_from_code_and_authenticator'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:231:in `oauth2_fetch_client_and_user_from_cookie'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:221:in `oauth2_fetch_client_and_user'
/Users/alexandrecarriere/.bundler/ruby/1.8/facebooker2-504cc261af61/lib/facebooker2/rails/controller.rb:16:in `current_facebook_user'
app/controllers/application_controller.rb:31:in `current_user'
app/controllers/users_controller.rb:28:in `show'


from facebooker2.

derrimahendra avatar derrimahendra commented on August 16, 2024

Hi Mike for until a few month ago it still work, i can login and i can fetch current_facebook_user, now i just can login but can't fetch current_facebook_user, i try to remove fbsr cookies but it just remove the cookie and still can't fetch current_faebook_user.

I just add facebooker2 and authlogic_facebook_connect together. it's work before.

from facebooker2.

mmangino avatar mmangino commented on August 16, 2024

You should be able to get it once per login. Once you exchange the auth code for a token, you'll need to store the token and rebuild the user from that.

Mike

On Dec 10, 2012, at 7:56 PM, derri [email protected] wrote:

Hi Mike for until a few month ago it still work, i can login and i can fetch current_facebook_user, now i just can login but can't fetch current_facebook_user, i try to remove fbsr cookies but it just remove the cookie and still can't fetch current_faebook_user.

I just add facebooker2 and authlogic_facebook_connect together. it's work before.


Reply to this email directly or view it on GitHub.

from facebooker2.

ciscodesign avatar ciscodesign commented on August 16, 2024

Same problem form me

mogli (0.0.36) lib/mogli/client.rb:79:in raise_error_by_type_and_message' mogli (0.0.36) lib/mogli/client.rb:70:inraise_client_exception'
mogli (0.0.36) lib/mogli/client.rb:52:in create_from_code_and_authenticator' (eval):2:insend'
(eval):2:in current_facebook_user' app/views/layouts/_menu_user_right.html.erb:8 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:inrender'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:inrender'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in render_partial' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:intrace_execution_scoped'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in render_partial' app/views/layouts/_menu.html.erb:21 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:inrender'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:inrender'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:in render_partial' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:intrace_execution_scoped'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:in render_partial' app/views/layouts/home.html.erb:56 /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:392:inrender'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:387:inrender'
app/controllers/pages_controller.rb:143:in home' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:inperform_action'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/method_tracer.rb:191:in trace_execution_scoped' /data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:248:inperform_action'
warden (0.10.7) lib/warden/manager.rb:35:in call' warden (0.10.7) lib/warden/manager.rb:35:incall'
warden (0.10.7) lib/warden/manager.rb:34:in catch' warden (0.10.7) lib/warden/manager.rb:34:incall'
/data/groupsale/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.1.0/lib/new_relic/rack/browser_monitoring.rb:18:in call' devise (1.0.11) lib/devise/rails/warden_compat.rb:43:incall'

How can i solve?

from facebooker2.

mmangino avatar mmangino commented on August 16, 2024

I just pushed a completely untested change that should cache the required info. Can you try running with the facebooker2 from git to see if that fixes things?

from facebooker2.

derrimahendra avatar derrimahendra commented on August 16, 2024

I install it as plugin,this is what I get:

ActionView::TemplateError (Constant Facebooker2::Rails::Controller::Moglie from facebooker2/rails/controller/moglie.rb not found
Constant Facebooker2::Rails::Moglie from facebooker2/rails/moglie.rb not found
Constant Facebooker2::Moglie from facebooker2/moglie.rb not found
Constant Moglie from moglie.rb not found) on line #17 of themes/dappled/views/shared/_user_menu.html.haml:

from facebooker2.

mmangino avatar mmangino commented on August 16, 2024

I just fixed the type. Can you try again?

Mike

On Dec 12, 2012, at 10:36 AM, derri [email protected] wrote:

I install it as plugin,this is what I get:

ActionView::TemplateError (Constant Facebooker2::Rails::Controller::Moglie from facebooker2/rails/controller/moglie.rb not found
Constant Facebooker2::Rails::Moglie from facebooker2/rails/moglie.rb not found
Constant Facebooker2::Moglie from facebooker2/moglie.rb not found
Constant Moglie from moglie.rb not found) on line #17 of themes/dappled/views/shared/_user_menu.html.haml:


Reply to this email directly or view it on GitHub.

from facebooker2.

derrimahendra avatar derrimahendra commented on August 16, 2024

I get this :
undefined method `sign_in_user_and_client' for #BaseController:0xc2ee850

there a typo lib/facebooker2/rails/controller.rb line 234

if i change it to fb_sign_in_user_and_client it's work fine

from facebooker2.

derrimahendra avatar derrimahendra commented on August 16, 2024

i'm sorry when I try to logout and try to sign in again, this i what I get:

Mogli::Client::OAuthException (Error validating access token: The session is invalid because the user logged out.):

from facebooker2.

mmangino avatar mmangino commented on August 16, 2024

I added an fb_logout! method that you can call when that error is raised. You should be able to call that and then go through the login process.

Mike

On Dec 12, 2012, at 10:51 AM, derri [email protected] wrote:

i'm sorry when I try to logout and try to sign in again, this i what I get:

Mogli::Client::OAuthException (Error validating access token: The session is invalid because the user logged out.):


Reply to this email directly or view it on GitHub.

from facebooker2.

derrimahendra avatar derrimahendra commented on August 16, 2024

It's work for now, I'll check it again tomorrow

Thanks Mike

from facebooker2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.