feat: Activation de compte utilisateur avec validation token
L'inscription Classeo se fait via invitation : un admin crée un compte, l'utilisateur reçoit un lien d'activation par email pour définir son mot de passe. Ce flow sécurisé évite les inscriptions non autorisées et garantit que seuls les utilisateurs légitimes accèdent au système. Points clés de l'implémentation : - Tokens d'activation à usage unique stockés en cache (Redis/filesystem) - Validation du consentement parental pour les mineurs < 15 ans (RGPD) - L'échec d'activation ne consume pas le token (retry possible) - Users dans un cache séparé sans TTL (pas d'expiration) - Hot reload en dev (FrankenPHP sans mode worker) Story: 1.3 - Inscription et activation de compte
This commit is contained in:
69
.github/workflows/ci.yml
vendored
69
.github/workflows/ci.yml
vendored
@@ -128,11 +128,74 @@ jobs:
|
||||
- name: Run unit tests
|
||||
run: pnpm run test
|
||||
|
||||
# =============================================================================
|
||||
# E2E Tests - Playwright with Docker backend
|
||||
# =============================================================================
|
||||
test-e2e:
|
||||
name: E2E Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-cache
|
||||
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache pnpm dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install frontend dependencies
|
||||
working-directory: frontend
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Playwright browsers
|
||||
working-directory: frontend
|
||||
run: pnpm exec playwright install --with-deps
|
||||
|
||||
- name: Build and start backend services
|
||||
run: |
|
||||
# Build images first (with Docker layer caching)
|
||||
docker compose build php
|
||||
# Start services (includes db, redis, rabbitmq dependencies)
|
||||
docker compose up -d php
|
||||
timeout-minutes: 10
|
||||
|
||||
- name: Wait for backend to be ready
|
||||
run: |
|
||||
echo "Waiting for backend to be ready (composer install + app startup)..."
|
||||
# Wait up to 5 minutes for the backend to respond
|
||||
timeout 300 bash -c 'until curl -sf http://localhost:18000/api > /dev/null 2>&1; do
|
||||
echo "Waiting for backend..."
|
||||
sleep 5
|
||||
done'
|
||||
echo "Backend is ready!"
|
||||
|
||||
- name: Show backend logs on failure
|
||||
if: failure()
|
||||
run: docker compose logs php
|
||||
|
||||
- name: Run E2E tests
|
||||
working-directory: frontend
|
||||
run: pnpm run test:e2e
|
||||
env:
|
||||
# Frontend serves on 4173 (preview mode), backend on 18000 (Docker)
|
||||
PUBLIC_API_PORT: "18000"
|
||||
PUBLIC_API_URL: http://localhost:18000/api
|
||||
|
||||
- name: Upload Playwright report
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -142,6 +205,10 @@ jobs:
|
||||
path: frontend/playwright-report/
|
||||
retention-days: 7
|
||||
|
||||
- name: Stop backend services
|
||||
if: always()
|
||||
run: docker compose down
|
||||
|
||||
# =============================================================================
|
||||
# Naming Conventions Check
|
||||
# =============================================================================
|
||||
@@ -161,7 +228,7 @@ jobs:
|
||||
build:
|
||||
name: Build Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-backend, test-frontend]
|
||||
needs: [test-backend, test-frontend, test-e2e]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user