Skip to content

Instantly share code, notes, and snippets.

@dmvt
dmvt / gist:9316144
Last active August 29, 2015 13:56 — forked from herval/gist:951054
Ruby class which verifies Facebook authentication given the app secret and both a signed_request and user_id from the JavaScript SDK
# Personal Note: It was while working on this code that I heard about Jim Weirich's death. Sad day. RIP, Jim.
class FBAuth
attr_reader :errors, :signed_request, :user_id
def initialize(app_secret, signed_request, user_id)
@app_secret = app_secret
@errors = []
@now = Time.now
@signed_request = signed_request