Facebook Callback appends '#_=_' to Return URL

前端 未结 23 2176
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 14:56

Facebook callback has started appending #_=_ hash underscore to the Return URL

Does anyone know why? What is the solution?

23条回答
  •  天命终不由人
    2020-11-22 15:14

    via Facebook's Platform Updates:

    Change in Session Redirect Behavior

    This week, we started adding a fragment #____=____ to the redirect_uri when this field is left blank. Please ensure that your app can handle this behavior.

    To prevent this, set the redirect_uri in your login url request like so: (using Facebook php-sdk)

    $facebook->getLoginUrl(array('redirect_uri' => $_SERVER['SCRIPT_URI'],'scope' => 'user_about_me'));
    

    UPDATE

    The above is exactly as the documentation says to fix this. However, Facebook's documented solution does not work. Please consider leaving a comment on the Facebook Platform Updates blog post and follow this bug to get a better answer. Until then, add the following to your head tag to resolve this issue:

    
    

    Or a more detailed alternative (thanks niftylettuce):

    
    

提交回复
热议问题