Gregniuki commited on
Commit
e3afd2e
1 Parent(s): 1acc3a6

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -15,7 +15,7 @@ app = FastAPI()
15
  templates = Jinja2Templates(directory="templates")
16
 
17
  # Include the authentication router with the prefix '/auth'
18
- #app.include_router(auth.router, prefix="/auth")
19
 
20
  # Include the TTS router with the prefix '/tts'
21
  #app.include_router(tts.router, prefix="/tts")
@@ -35,14 +35,14 @@ async def landing(request: Request):
35
  @app.get("/login", response_class=HTMLResponse)
36
  async def login(request: Request):
37
  return templates.TemplateResponse("login.html", {"request": request})
 
 
 
 
38
  @app.post("/register", response_class=HTMLResponse)
39
  async def register_post(request: Request, user: UserCreate, db: Session = Depends(get_db)):
40
- registered_user = register(user, db)
41
  return RedirectResponse("/registration_successful")
42
- @app.get("/registration_successful", response_class=HTMLResponse)
43
- async def registration_successful(request: Request):
44
- return templates.TemplateResponse("registration_successful.html", {"request": request})
45
-
46
 
47
  @app.get("/verify/{verification_token}", response_class=HTMLResponse)
48
  async def verify_email(verification_token: str, request: Request, db: Session = Depends(get_db)):
 
15
  templates = Jinja2Templates(directory="templates")
16
 
17
  # Include the authentication router with the prefix '/auth'
18
+ #app.include_router(auth.router, prefix="")
19
 
20
  # Include the TTS router with the prefix '/tts'
21
  #app.include_router(tts.router, prefix="/tts")
 
35
  @app.get("/login", response_class=HTMLResponse)
36
  async def login(request: Request):
37
  return templates.TemplateResponse("login.html", {"request": request})
38
+ @app.get("/register", response_class=HTMLResponse)
39
+ async def register_get(request: Request):
40
+ return templates.TemplateResponse("register.html", {"request": request})
41
+
42
  @app.post("/register", response_class=HTMLResponse)
43
  async def register_post(request: Request, user: UserCreate, db: Session = Depends(get_db)):
44
+ registered_user = auth.register(user, db)
45
  return RedirectResponse("/registration_successful")
 
 
 
 
46
 
47
  @app.get("/verify/{verification_token}", response_class=HTMLResponse)
48
  async def verify_email(verification_token: str, request: Request, db: Session = Depends(get_db)):