Created
February 6, 2012 19:10
-
-
Save mokevnin/1754139 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::Account::FacebookController < Web::Account::ApplicationController | |
| def create_link | |
| fb_hash = FacebookIntegration.get_auth_hash( | |
| create_link_account_facebook_url, params['code']) | |
| FacebookService.create_link(current_user, fb_hash) | |
| redirect_to account_root_url, | |
| :notice => t('web.messages.account.facebook.linked') | |
| rescue UserBlockedError | |
| redirect_to account_root_url, | |
| :error => t('web.messages.users.blocked') | |
| rescue AlreadyLinkedError | |
| redirect_to account_root_url, | |
| :error => t('web.messages.account.facebook.already_linked') | |
| rescue ServiceError | |
| redirect_to account_root_url, | |
| :error => t('web.messages.account.facebook.link_failure') | |
| end | |
| def destroy | |
| if current_user.facebook | |
| current_user.facebook.destroy | |
| redirect_to account_root_url, | |
| :notice => I18n.t("web.messages.account.facebook.destroyed") | |
| else | |
| redirect_to account_root_url, | |
| :notice => I18n.t("web.messages.account.facebook.not_linked") | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment