Skip to content

Commit a0391b0

Browse files
committed
fix: correct auth callback indentation
1 parent 637e924 commit a0391b0

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

backend-api/app/api/v1/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ async def google_callback(
280280
status_code=status.HTTP_302_FOUND,
281281
)
282282

283-
try:
283+
try:
284284
user = await user_manager.oauth_callback(
285285
oauth_name="google",
286286
access_token=google_access_token,

backend-api/app/db/init_db.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Run this script to create the default admin user:
55
python -m app.db.init_db
66
"""
7+
78
import asyncio
89

910
from fastapi_users.password import PasswordHelper
@@ -19,20 +20,17 @@ async def init_db():
1920
2021
IMPORTANT:
2122
- Passwords are stored hashed in the DB (see User.hashed_password).
22-
- This script will create OR update a default admin user for local development.
23+
- This script will create or update a default admin user for local development.
2324
"""
2425
admin_email = "admin@example.com"
2526
admin_password = "admin" # pragma: allowlist secret # nosec B105
2627

2728
password_helper = PasswordHelper()
2829

2930
async with async_session_maker() as session:
30-
# Look up the canonical seed user.
3131
result = await session.execute(
3232
select(User).where(User.email == admin_email)
3333
)
34-
35-
# Be resilient to relationship eager-loads that can duplicate rows.
3634
existing_user = result.unique().scalar_one_or_none()
3735

3836
created = False
@@ -44,7 +42,6 @@ async def init_db():
4442
admin_user = User(email=admin_email)
4543
session.add(admin_user)
4644

47-
# Ensure the account is a usable admin for local development.
4845
admin_user.hashed_password = password_helper.hash(admin_password)
4946
admin_user.role = Role.ADMIN.value
5047
admin_user.is_active = True
@@ -54,14 +51,14 @@ async def init_db():
5451
await session.commit()
5552

5653
print(
57-
"[SUCCESS] Created default admin user with the following details."
54+
"[SUCCESS] Created default admin user."
5855
if created
59-
else "[SUCCESS] Updated default admin user with the following details."
56+
else "[SUCCESS] Updated default admin user."
6057
)
6158
print(f" Email: {admin_email}")
62-
print(f" Password: {admin_password}")
6359
print(f" Role: {Role.ADMIN.value}")
64-
print("\nIMPORTANT: Change this password after first login.")
60+
print(" Default development credentials have been configured.")
61+
print("\nIMPORTANT: Change the default password after first login.")
6562

6663

6764
if __name__ == "__main__":

0 commit comments

Comments
 (0)