Skip to content

Commit 418c24f

Browse files
committed
Fix creating token auth method "none" client
ref: authlib#67
1 parent a36b9e0 commit 418c24f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

website/routes.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ def create_client():
6868
user_id=user.id,
6969
)
7070

71-
if client.token_endpoint_auth_method == 'none':
72-
client.client_secret = ''
73-
else:
74-
client.client_secret = gen_salt(48)
75-
7671
form = request.form
7772
client_metadata = {
7873
"client_name": form["client_name"],
@@ -84,6 +79,12 @@ def create_client():
8479
"token_endpoint_auth_method": form["token_endpoint_auth_method"]
8580
}
8681
client.set_client_metadata(client_metadata)
82+
83+
if form['token_endpoint_auth_method'] == 'none':
84+
client.client_secret = ''
85+
else:
86+
client.client_secret = gen_salt(48)
87+
8788
db.session.add(client)
8889
db.session.commit()
8990
return redirect('/')

0 commit comments

Comments
 (0)