tomarv2
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
fastapi/security/oauth2.py
|
|
@ -15,7 +15,7 @@ class OAuth2PasswordRequestForm: |
|
|
|
This is a dependency class, use it like: |
|
|
|
|
|
|
|
@app.post("/login") |
|
|
|
def login(form_data: Oauth2PasswordRequestForm = Depends()): |
|
|
|
def login(form_data: OAuth2PasswordRequestForm = Depends()): |
|
|
|
data = form_data.parse() |
|
|
|
print(data.username) |
|
|
|
print(data.password) |
|
|
@ -65,7 +65,7 @@ class OAuth2PasswordRequestFormStrict(OAuth2PasswordRequestForm): |
|
|
|
This is a dependency class, use it like: |
|
|
|
|
|
|
|
@app.post("/login") |
|
|
|
def login(form_data: Oauth2PasswordRequestFormStrict = Depends()): |
|
|
|
def login(form_data: OAuth2PasswordRequestFormStrict = Depends()): |
|
|
|
data = form_data.parse() |
|
|
|
print(data.username) |
|
|
|
print(data.password) |
|
|
|