yesod-auth-oauth2/Yesod/Auth
patrick brisbin ad561a09d6
Append the state query parameter correctly
If the endpoint URL doesn't yet have any query parameters, this code
would construct an invalid URL by appending `&state=` rather than
`?state=`. We now correctly append `?state=` or `&state=` depending on
the URL already containing a `?` character.

Fixes #44

This is a "good enough" solution for the moment, done for ease of
implementation and speed of delivery. An eventual better solution would
be to use a URL-parsing and constructing library to parse the existing
endpoint, append parameter tuples, and re-construct a new URL.

Restructuring the data types so we start handling real URL and
QueryParam values instead of ByteStrings would also be an option, though
we're a little cornered by the Yesod.Auth.OAuth interface.
2015-11-28 11:42:05 -05:00
..
OAuth2 Switch to newer Nylas API endpoint 2015-08-20 15:32:32 -04:00
OAuth2.hs Append the state query parameter correctly 2015-11-28 11:42:05 -05:00