ルビー、シナトラ、コアラの宝石を使用して Facebook 用のアプリを作成しています。/auth/facebook にリダイレクトすると、必要なことは実行されますが、最初にこの長方形のあるページにリダイレクトされてから、認証ダイアログに移動します。これはエンドユーザーにとって非常に見苦しいと思います。この奇妙なリダイレクトを削除するにはどうすればよいですか?
コード:
#This function defines a get and post route with the same parameters.
def get_or_post(path, opts={}, &block)
get(path, opts, &block)
post(path, opts, &block)
end
get "/auth/facebook/?" do
redirect authenticator.url_for_oauth_code(:permissions => FACEBOOK_SCOPE)
end
get_or_post '/auth/facebook/callback/?' do
session[:access_token] = authenticator.get_access_token(params[:code])
update_user()
redirect '/'
end