Skip to content

Commit 12f37b5

Browse files
committed
add cross_origin to token endpoint
1 parent 8cd4d58 commit 12f37b5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

auth/oauth.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from flask_oauthlib.provider import OAuth2Provider
66
from oauthlib.common import generate_token as generate_random_token
77
from flask_login import current_user, login_required
8+
from flask_cors import cross_origin
89

910
from auth.login.base import demand_pebble
1011
from .models import db, IssuedToken, AuthClient, User
@@ -118,6 +119,7 @@ def authorise(*args, **kwargs):
118119
return 'confirm' in request.form
119120

120121
@oauth_bp.route('/token', methods=['GET', 'POST'])
122+
@cross_origin()
121123
@oauth.token_handler
122124
def access_token():
123125
return None

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ Werkzeug==0.15.3
3434
WTForms==2.2.1
3535
honeycomb-beeline==2.11.4
3636
gunicorn
37+
Flask-Cors==3.0.6

0 commit comments

Comments
 (0)