how to handle CHybridAuth – Oophs. Error! – access denied

When you make the user login to your website via a social network like facebook and the user is directed by CHybridAuth to the social network (facebook). Then the user has two choices to either allow or cancel the access to your app. If the user happens to cancel the access then the class Endpoint in CHybridAuth throws an exception (like Oophs. Error! – access denied ) which is not useful for users and looks not so nice.

To handle this I simply added the following code to actionEndpoint:

  // my updated version of actionEndpoint()
  public function actionEndpoint(){
    if (isset($_GET['error']) && $_GET['error']=='access_denied') {
    	throw new CHttpException(403,'Access denied');
    	return;
    }
    Yii::app()->hybridAuth->endPoint();
  }

This has been implemented on site fillup.se

SOLVED – yii font awesome showing square

Some times you get squares on the web page although you have added the css file font-awesome.css successfully. The solution is very easy you and need to place the font directory (containing four font files) as well inside the CSS folder where you have placed font-awesome.css.

The font directory contains four other font files.

fontawesome-webfont.eot

fontawesome-webfont.ttf

fontawesome-webfont.woff

FontAwesome.otf