Skip to content

Commit

Permalink
Fix OAuth URL building (#462)
Browse files Browse the repository at this point in the history
This line:

```
builder.query = URI.encode_www_form(build_query(config)).gsub!("+", "%20")
```

Replaces the whole value, so the Auth doesn’t work.

Replaced it with this:

```
builder.query = URI.encode_www_form(build_query(config)).gsub(/\+/, "%20")
```
  • Loading branch information
atejada authored Feb 8, 2024
1 parent eeb47e8 commit 740631d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/nylas/resources/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def build_query_with_pkce(config, secret_hash)
def url_auth_builder(config)
builder = URI.parse(api_uri)
builder.path = "/v3/connect/auth"
builder.query = URI.encode_www_form(build_query(config)).gsub!("+", "%20")
builder.query = URI.encode_www_form(build_query(config)).gsub(/\+/, "%20")

builder
end
Expand Down

0 comments on commit 740631d

Please sign in to comment.