File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ def before_app_request() -> None:
54
54
55
55
def login_required (f : Callable ) -> Callable :
56
56
"""Decorate the function to redirect to the login page if a user is not logged in."""
57
+
57
58
@wraps (f )
58
59
def decorated_function (* args , ** kwargs ):
59
60
if g .user is None :
@@ -134,10 +135,10 @@ def github_token_validity(token: str):
134
135
from run import config
135
136
github_client_id = config .get ('GITHUB_CLIENT_ID' , '' )
136
137
github_client_secret = config .get ('GITHUB_CLIENT_SECRET' , '' )
137
- url = f'https://api.github.com/applications/{ github_client_id } /tokens/ { token } '
138
+ url = f'https://api.github.com/applications/{ github_client_id } /token'
138
139
session = requests .Session ()
139
140
session .auth = (github_client_id , github_client_secret )
140
- response = session .get (url )
141
+ response = session .post (url , json = { "access_token" : token } )
141
142
142
143
return response .status_code == 200
143
144
You can’t perform that action at this time.
0 commit comments