Skip to content

Commit 2ca3496

Browse files
authored
Fix authorize_url (#6)
* Updates to README * OAuthScope reference updates * Removed space in outh.authorize_url to construct valid URL * Remove comma
1 parent a14ad5e commit 2ca3496

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ for more details.
6868
from webflow.oauth import authorize_url
6969
from webflow import OauthScope
7070

71-
url = webflow.authorize_url({
72-
client_id = "[CLIENT ID]",
73-
scope = OauthScope.ReadUsers, # or [OauthScope.ReadUsers, OauthScope.WriteUsers]
74-
state = "1234567890", # optional
75-
redirect_uri = "https://my.server.com/oauth/callback", # optional
76-
});
71+
url = authorize_url(
72+
client_id="[CLIENT ID]",
73+
scope=OauthScope.USERS_READ, # or [OauthScope.USERS_READ, OauthScope.USERS_WRITE]
74+
state="1234567890", # optional
75+
redirect_uri="https://my.server.com/oauth/callback", # optional
76+
);
7777

7878
print(url)
7979
```
@@ -89,7 +89,7 @@ client = Webflow(
8989
client_id="YOUR_CLIENT_ID",
9090
client_secret="YOUR_CLIENT_SECRET",
9191
code="YOUR_AUTHORIZATION_CODE",
92-
redirect_uri = "https://my.server.com/oauth/callback", # optional
92+
redirect_uri="https://my.server.com/oauth/callback", # optional
9393
)
9494
```
9595

@@ -131,7 +131,7 @@ except webflow.BadRequestError as e: # Handle specific error
131131
## Advanced
132132

133133
### Timeouts
134-
By default requests time out after 60 seconds. You can configure this with a
134+
By default, requests time out after 60 seconds. You can configure this with a
135135
timeout option, which accepts a float.
136136

137137
```python
@@ -144,7 +144,7 @@ client = Webflow(
144144
```
145145

146146
### Custom HTTP client
147-
You can override the httpx client to customize it for your use case. Some common usecases
147+
You can override the httpx client to customize it for your use case. Some common use-cases
148148
include support for proxies and transports.
149149

150150
```python

src/webflow/oauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def authorize_url(
5858
if scope is not OMIT and isinstance(scope, str):
5959
params["scope"] = scope.value
6060
elif scope is not OMIT:
61-
params["scope"] = ", ".join([s.value for s in scope]) # type: ignore
61+
params["scope"] = " ".join([s.value for s in scope]) # type: ignore
6262
return f"https://webflow.com/oauth/authorize?{urllib.parse.urlencode(params)}"
6363

6464

0 commit comments

Comments
 (0)