File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
OAUTH2_CLIENT_ID = eccd08d6736b7999a32a
2
2
OAUTH2_CLIENT_SECRET = 642999c1c5f2b3df8b877afdc78252ef5b594d31
3
- OAUTH2_CALLBACK_URL = http://127.0.0.1:8000/auth/callback
3
+ OAUTH2_CALLBACK_URL = http://127.0.0.1:8000/oauth2/token
4
4
OAUTH2_REDIRECT_URL = http://127.0.0.1:8000/
5
5
6
6
JWT_SECRET = secret
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ async def get_token_data(
98
98
params : Optional [Dict [str , Any ]] = None ,
99
99
headers : Optional [Dict [str , Any ]] = None ,
100
100
redirect_uri : Optional [str ] = None ,
101
- ) -> Optional [dict ]:
101
+ ) -> Optional [Dict [ str , Any ] ]:
102
102
params = params or {}
103
103
additional_headers = headers or {}
104
104
additional_headers .update (self .additional_headers or {})
Original file line number Diff line number Diff line change 10
10
OAUTH2_REDIRECT_URL ,
11
11
)
12
12
13
- router = APIRouter ()
13
+ router = APIRouter (prefix = "/oauth2" )
14
14
oauth2 = GitHubOAuth2 (
15
15
client_id = OAUTH2_CLIENT_ID ,
16
16
client_secret = OAUTH2_CLIENT_SECRET ,
19
19
)
20
20
21
21
22
- @router .get ("/auth/ login" )
22
+ @router .get ("/login" )
23
23
async def login ():
24
24
return await oauth2 .login_redirect ()
25
25
26
26
27
- @router .get ("/auth/callback " )
28
- async def callback (request : Request ):
27
+ @router .get ("/token " )
28
+ async def token (request : Request ):
29
29
return await oauth2 .token_redirect (request )
30
30
31
31
32
- @router .get ("/auth/ logout" )
32
+ @router .get ("/logout" )
33
33
async def logout ():
34
34
response = RedirectResponse (OAUTH2_REDIRECT_URL )
35
35
response .delete_cookie ("Authorization" )
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments