Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/backend/app/api/routes/auth/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
)
from app.api.routes.auth.users_repo import (
clear_refresh_token_hash,
complete_onboarding,
find_uid_by_refresh_hash,
get_backup_code_by_id,
get_master_vault,
Expand Down Expand Up @@ -79,6 +80,7 @@ async def create_session(request: Request, payload: SessionRequest, response: Re
photo_url=doc.get("photo_url"),
email_verified=bool(doc.get("email_verified")),
disabled=bool(doc.get("disabled")),
onboarding_completed=bool(doc.get("onboarding_completed", False)),
)


Expand Down Expand Up @@ -359,3 +361,20 @@ async def use_backup_code_endpoint(
) -> OkResponse:
await mark_backup_code_used(uid, payload.codeId)
return OkResponse(ok=True)


# ── Onboarding ────────────────────────────────────────────────────────────────


@router.post(
"/onboarding/complete",
response_model=OkResponse,
summary="Mark onboarding as completed for the current user",
)
@limiter.limit("10/minute")
async def complete_onboarding_endpoint(
request: Request,
uid: Annotated[str, Depends(get_current_uid)],
) -> OkResponse:
await complete_onboarding(uid)
return OkResponse(ok=True)
1 change: 1 addition & 0 deletions apps/backend/app/api/routes/auth/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class UserProfileResponse(BaseModel):
certifications: list[Certification] = Field(default_factory=list)
portfolio_settings: PortfolioSettings | None = None
personal_info: PersonalInfo | None = None
onboarding_completed: bool = False


class UpdateProfileRequest(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions apps/backend/app/api/routes/auth/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ async def get_current_user(uid: str = Depends(get_current_uid)) -> UserProfileRe
certifications=[Certification(**c) for c in doc.get("certifications") or []],
portfolio_settings=doc.get("portfolio_settings"),
personal_info=PersonalInfo(**doc["personal_info"]) if doc.get("personal_info") else None,
onboarding_completed=bool(doc.get("onboarding_completed", False)),
)
14 changes: 13 additions & 1 deletion apps/backend/app/api/routes/auth/users_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ async def upsert_user_from_firebase_claims(decoded: dict[str, Any]) -> None:
"disabled": False,
"updated_at": now,
}
await db_manager.update_one(USERS, {"_id": uid}, {"$set": doc, "$setOnInsert": {"created_at": now}}, upsert=True)
await db_manager.update_one(
USERS,
{"_id": uid},
{"$set": doc, "$setOnInsert": {"created_at": now, "onboarding_completed": False}},
upsert=True,
)


async def get_user_doc(uid: str) -> dict[str, Any] | None:
Expand Down Expand Up @@ -98,6 +103,13 @@ async def get_backup_code_by_id(uid: str, code_id: str) -> dict[str, Any] | None
return None


async def complete_onboarding(uid: str) -> None:
now = create_timestamp()
await db_manager.update_one(
USERS, {"_id": uid}, {"$set": {"onboarding_completed": True, "updated_at": now}}
)


async def mark_backup_code_used(uid: str, code_id: str) -> None:
now = create_timestamp()
await db_manager.update_one(
Expand Down
15 changes: 15 additions & 0 deletions apps/web/messages/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Kodesnippette",
"qrCodeGenerator": "QR-kodegenerator",
"dnsLookup": "DNS-soektog",
"ipSubnetCalculator": "IP-/subnetrekenaar",
"hashGenerator": "Hash-generator",
"hmacGenerator": "HMAC-generator",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Sleutelgenerering het misluk"
}
},
"DnsLookup": {
"title": "DNS-soektog",
"subtitle": "Navraag DNS-rekords vir enige domein — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Voer domein in (bv. github.com)",
"lookupBtn": "Soek",
"looking": "Soek tans…",
"refreshBtn": "Verfris",
"recordTypesLabel": "Rekordtipes",
"allBtn": "Alles",
"tryLabel": "Probeer:",
"errors": {
"lookupFailed": "DNS-soektog het misluk"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "مقاطع الشيفرة",
"qrCodeGenerator": "مُولّد رمز QR",
"dnsLookup": "بحث DNS",
"ipSubnetCalculator": "حاسبة IP / الشبكة الفرعية",
"hashGenerator": "مُولّد الهاش",
"hmacGenerator": "مُولّد HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "فشل إنشاء المفتاح"
}
},
"DnsLookup": {
"title": "بحث DNS",
"subtitle": "استعلام عن سجلات DNS لأي نطاق — A، AAAA، MX، TXT، NS، CNAME.",
"placeholder": "أدخل النطاق (مثل github.com)",
"lookupBtn": "بحث",
"looking": "جارٍ البحث…",
"refreshBtn": "تحديث",
"recordTypesLabel": "أنواع السجلات",
"allBtn": "الكل",
"tryLabel": "جرّب:",
"errors": {
"lookupFailed": "فشل بحث DNS"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Fragments de codi",
"qrCodeGenerator": "Generador de codis QR",
"dnsLookup": "Cerca DNS",
"ipSubnetCalculator": "Calculadora IP / subxarxa",
"hashGenerator": "Generador de hash",
"hmacGenerator": "Generador HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "La generació de la clau ha fallat"
}
},
"DnsLookup": {
"title": "Cerca DNS",
"subtitle": "Consulta els registres DNS de qualsevol domini — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Introdueix un domini (p. ex. github.com)",
"lookupBtn": "Cerca",
"looking": "Cercant…",
"refreshBtn": "Actualitza",
"recordTypesLabel": "Tipus de registres",
"allBtn": "Tots",
"tryLabel": "Prova:",
"errors": {
"lookupFailed": "Ha fallat la consulta DNS"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Úryvky kódu",
"qrCodeGenerator": "Generátor QR kódů",
"dnsLookup": "Vyhledávání DNS",
"ipSubnetCalculator": "Kalkulačka IP / podsítě",
"hashGenerator": "Generátor hashů",
"hmacGenerator": "Generátor HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Generování klíče selhalo"
}
},
"DnsLookup": {
"title": "Vyhledávání DNS",
"subtitle": "Dotazujte DNS záznamy pro libovolnou doménu — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Zadejte doménu (např. github.com)",
"lookupBtn": "Vyhledat",
"looking": "Vyhledávám…",
"refreshBtn": "Obnovit",
"recordTypesLabel": "Typy záznamů",
"allBtn": "Vše",
"tryLabel": "Zkusit:",
"errors": {
"lookupFailed": "Vyhledávání DNS selhalo"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Kodestykker",
"qrCodeGenerator": "QR-kodegenerator",
"dnsLookup": "DNS-opslag",
"ipSubnetCalculator": "IP-/subnetberegner",
"hashGenerator": "Hash-generator",
"hmacGenerator": "HMAC-generator",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Nøglegenerering mislykkedes"
}
},
"DnsLookup": {
"title": "DNS-opslag",
"subtitle": "Forespørg DNS-poster for ethvert domæne — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Indtast domæne (f.eks. github.com)",
"lookupBtn": "Slå op",
"looking": "Slår op…",
"refreshBtn": "Opdater",
"recordTypesLabel": "Posttyper",
"allBtn": "Alle",
"tryLabel": "Prøv:",
"errors": {
"lookupFailed": "DNS-opslag mislykkedes"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Code-Snippets",
"qrCodeGenerator": "QR-Code-Generator",
"dnsLookup": "DNS-Abfrage",
"ipSubnetCalculator": "IP-/Subnetz-Rechner",
"hashGenerator": "Hash-Generator",
"hmacGenerator": "HMAC-Generator",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Schlüsselgenerierung fehlgeschlagen"
}
},
"DnsLookup": {
"title": "DNS-Abfrage",
"subtitle": "DNS-Einträge für jede Domain abfragen — A, AAAA, MX, TXT, NS, CNAME, SOA, CAA.",
"placeholder": "Domain eingeben (z. B. github.com)",
"lookupBtn": "Abfragen",
"looking": "Abfrage läuft…",
"refreshBtn": "Aktualisieren",
"recordTypesLabel": "Eintragstypen",
"allBtn": "Alle",
"tryLabel": "Beispiele:",
"errors": {
"lookupFailed": "DNS-Abfrage fehlgeschlagen"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Αποσπάσματα κώδικα",
"qrCodeGenerator": "Δημιουργός κωδικών QR",
"dnsLookup": "Αναζήτηση DNS",
"ipSubnetCalculator": "Υπολογιστής IP / υποδικτύου",
"hashGenerator": "Γεννήτρια hash",
"hmacGenerator": "Γεννήτρια HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Η δημιουργία κλειδιού απέτυχε"
}
},
"DnsLookup": {
"title": "Αναζήτηση DNS",
"subtitle": "Αναζητήστε εγγραφές DNS για οποιοδήποτε τομέα — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Εισαγάγετε τομέα (π.χ. github.com)",
"lookupBtn": "Αναζήτηση",
"looking": "Γίνεται αναζήτηση…",
"refreshBtn": "Ανανέωση",
"recordTypesLabel": "Τύποι εγγραφών",
"allBtn": "Όλα",
"tryLabel": "Δοκιμάστε:",
"errors": {
"lookupFailed": "Η αναζήτηση DNS απέτυχε"
}
}
}
1 change: 1 addition & 0 deletions apps/web/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"uuidGenerator": "UUID / ULID",
"secretApiKeyGenerator": "Secret / API key",
"qrCodeGenerator": "QR Code Generator",
"dnsLookup": "DNS Lookup",
"ipSubnetCalculator": "IP / Subnet Calculator",
"hashGenerator": "Hash Generator",
"hmacGenerator": "HMAC Generator",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Fragmentos de código",
"qrCodeGenerator": "Generador de códigos QR",
"dnsLookup": "Búsqueda DNS",
"ipSubnetCalculator": "Calculadora IP / subred",
"hashGenerator": "Generador de hash",
"hmacGenerator": "Generador HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Error al generar la clave"
}
},
"DnsLookup": {
"title": "Búsqueda DNS",
"subtitle": "Consulta registros DNS de cualquier dominio — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Introduce un dominio (p. ej. github.com)",
"lookupBtn": "Consultar",
"looking": "Consultando…",
"refreshBtn": "Actualizar",
"recordTypesLabel": "Tipos de registro",
"allBtn": "Todos",
"tryLabel": "Probar:",
"errors": {
"lookupFailed": "Error en la consulta DNS"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "قطعه‌کدها",
"qrCodeGenerator": "تولیدکنندهٔ QR",
"dnsLookup": "جستجوی DNS",
"ipSubnetCalculator": "ماشین‌حساب IP / زیرشبکه",
"hashGenerator": "تولیدکنندهٔ هش",
"hmacGenerator": "تولیدکنندهٔ HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "تولید کلید ناموفق بود"
}
},
"DnsLookup": {
"title": "جستجوی DNS",
"subtitle": "رکوردهای DNS هر دامنه را جستجو کنید — A، AAAA، MX، TXT، NS، CNAME.",
"placeholder": "دامنه را وارد کنید (مثلاً github.com)",
"lookupBtn": "جستجو",
"looking": "در حال جستجو…",
"refreshBtn": "تازه‌سازی",
"recordTypesLabel": "انواع رکورد",
"allBtn": "همه",
"tryLabel": "امتحان کنید:",
"errors": {
"lookupFailed": "جستجوی DNS ناموفق بود"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Extraits de code",
"qrCodeGenerator": "Générateur de codes QR",
"dnsLookup": "Recherche DNS",
"ipSubnetCalculator": "Calculateur IP / sous-réseau",
"hashGenerator": "Générateur de hash",
"hmacGenerator": "Générateur HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Échec de la génération de la clé"
}
},
"DnsLookup": {
"title": "Recherche DNS",
"subtitle": "Interrogez les enregistrements DNS d'un domaine — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Saisissez un domaine (p. ex. github.com)",
"lookupBtn": "Rechercher",
"looking": "Recherche en cours…",
"refreshBtn": "Actualiser",
"recordTypesLabel": "Types d'enregistrement",
"allBtn": "Tous",
"tryLabel": "Essayer :",
"errors": {
"lookupFailed": "Échec de la recherche DNS"
}
}
}
15 changes: 15 additions & 0 deletions apps/web/messages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"csvExcelJson": "CSV / Excel ↔ JSON",
"snippetManager": "Cuplikan kode",
"qrCodeGenerator": "Generator kode QR",
"dnsLookup": "Pencarian DNS",
"ipSubnetCalculator": "Kalkulator IP / subnet",
"hashGenerator": "Generator hash",
"hmacGenerator": "Generator HMAC",
Expand Down Expand Up @@ -3436,5 +3437,19 @@
"errors": {
"generationFailed": "Pembuatan kunci gagal"
}
},
"DnsLookup": {
"title": "Pencarian DNS",
"subtitle": "Kueri rekaman DNS untuk domain apa pun — A, AAAA, MX, TXT, NS, CNAME.",
"placeholder": "Masukkan domain (mis. github.com)",
"lookupBtn": "Cari",
"looking": "Mencari…",
"refreshBtn": "Segarkan",
"recordTypesLabel": "Jenis rekaman",
"allBtn": "Semua",
"tryLabel": "Coba:",
"errors": {
"lookupFailed": "Pencarian DNS gagal"
}
}
}
Loading