Created
February 6, 2012 19:10
-
-
Save mokevnin/1754138 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Web::User::FacebookController < Web::User::ApplicationController | |
| def register | |
| fb_hash = FacebookIntegration.get_auth_hash( | |
| register_user_facebook_url, params['code']) | |
| user = FacebookService.register(fb_hash) | |
| sign_in(user) | |
| redirect_to :root, :notice => t('web.messages.user.facebook.logged_in') | |
| rescue UserBlockedError | |
| redirect_to :root, :error => t('web.messages.users.blocked') | |
| rescue ConfirmationRequiredError => error | |
| request_provider_confirmation(error.user, | |
| configus.social.facebook.provider_name, auth_hash) | |
| redirect_to new_provider_confirmation_path, | |
| :notice => t('web.messages.user.facebook.confirm_connection') | |
| rescue ServiceError | |
| redirect_to :root, :error => t('web.messages.user.facebook.login_failed') | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment