intridea/omniauth-oauth2 — pull request #35 by petergoldstein (2013-03-31 20:18:23+00:00)
Title: Preserve state passed in to authorize_params

I know there's a lot of work being done that directly impacts the state logic, so this PR might be DOA, but I wanted to get the tests green.

Right now the authorize_params method is overwriting any state value passed into it with a randomly generated value. This is seemingly contrary to the intention of the method, is definitely contrary to the intention expressed in the OAuth 2 spec, and causes several tests to fail.

This minor change preserves a passed in state value if it is present. It also gets the tests running green.