• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vintasoftware / nextjs-fastapi-template / 12169631430

04 Dec 2024 10:43PM UTC coverage: 97.951% (+0.01%) from 97.939%
12169631430

Pull #36

github

web-flow
Merge 22a1261fc into ee6d93e12
Pull Request #36: Added suspense to confirmation page

78 of 82 branches covered (95.12%)

Branch coverage included in aggregate %.

56 of 56 new or added lines in 1 file covered. (100.0%)

1404 of 1431 relevant lines covered (98.11%)

6.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/fastapi_backend/app/main.py
1
from fastapi import Depends, FastAPI
1✔
2

3
from .database import User
1✔
4
from .schemas import UserCreate, UserRead, UserUpdate
1✔
5
from .users import auth_backend, current_active_user, fastapi_users, AUTH_URL_PATH
1✔
6
from fastapi.middleware.cors import CORSMiddleware
1✔
7
from .utils import simple_generate_unique_route_id
1✔
8

9

10
app = FastAPI(generate_unique_id_function=simple_generate_unique_route_id)
1✔
11

12

13
origins = [
1✔
14
    "http://localhost:3000",
15
    "http://localhost:8080",
16
]
17

18
app.add_middleware(
1✔
19
    CORSMiddleware,
20
    allow_origins=origins,
21
    allow_credentials=True,
22
    allow_methods=["*"],
23
    allow_headers=["*"],
24
)
25

26

27
app.include_router(
1✔
28
    fastapi_users.get_auth_router(auth_backend),
29
    prefix=f"/{AUTH_URL_PATH}/jwt",
30
    tags=["auth"],
31
)
32
app.include_router(
1✔
33
    fastapi_users.get_register_router(UserRead, UserCreate),
34
    prefix=f"/{AUTH_URL_PATH}",
35
    tags=["auth"],
36
)
37
app.include_router(
1✔
38
    fastapi_users.get_reset_password_router(),
39
    prefix=f"/{AUTH_URL_PATH}",
40
    tags=["auth"],
41
)
42
app.include_router(
1✔
43
    fastapi_users.get_verify_router(UserRead),
44
    prefix=f"/{AUTH_URL_PATH}",
45
    tags=["auth"],
46
)
47
app.include_router(
1✔
48
    fastapi_users.get_users_router(UserRead, UserUpdate),
49
    prefix="/users",
50
    tags=["users"],
51
)
52

53

54
@app.get("/authenticated-route", tags=["custom-auth"])
1✔
55
async def authenticated_route(user: User = Depends(current_active_user)):
1✔
56
    return {"message": f"Hello {user.email}!"}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc