Gregniuki commited on
Commit
fab519b
1 Parent(s): 7de903a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -4
main.py CHANGED
@@ -3,7 +3,6 @@
3
  from fastapi import FastAPI, Form, Depends, HTTPException
4
  from fastapi.requests import Request
5
  from fastapi.responses import HTMLResponse, RedirectResponse
6
- from fastapi.security import OAuth2PasswordRequestForm
7
  from fastapi.templating import Jinja2Templates
8
  from sqlalchemy.orm import Session
9
  from auth import verify_token, oauth2_scheme, auth_views, register, UserCreate, authenticate_user, get_user_by_verification_token
@@ -44,11 +43,11 @@ async def login(request: Request):
44
  @app.post("/login", response_class=HTMLResponse)
45
  async def login_post(
46
  request: Request,
47
- form_data: OAuth2PasswordRequestForm = Depends(),
 
48
  db: Session = Depends(get_db)
49
  ):
50
- email = form_data.username
51
- password = form_data.password
52
 
53
  # Validate the email and password
54
  if not email or not password:
 
3
  from fastapi import FastAPI, Form, Depends, HTTPException
4
  from fastapi.requests import Request
5
  from fastapi.responses import HTMLResponse, RedirectResponse
 
6
  from fastapi.templating import Jinja2Templates
7
  from sqlalchemy.orm import Session
8
  from auth import verify_token, oauth2_scheme, auth_views, register, UserCreate, authenticate_user, get_user_by_verification_token
 
43
  @app.post("/login", response_class=HTMLResponse)
44
  async def login_post(
45
  request: Request,
46
+ email: str = Form(...),
47
+ password: str = Form(...),
48
  db: Session = Depends(get_db)
49
  ):
50
+
 
51
 
52
  # Validate the email and password
53
  if not email or not password: