Backend: new migration adds users.email_verified_at (null = unverified); registration leaves it null, and the register/login/me payloads now expose email_verified and email_verified_at. Frontend (web/): Vite + Vue 3 + TypeScript PWA (vite-plugin-pwa). Pinia auth store keeps the token in localStorage and validates it via GET /api/me on load. vue-router guards redirect unauthenticated visitors to /login, preserving the intended path; /register creates an account and signs in immediately (with the email unverified). Placeholder home page, minimal styling, generated icons. Dev server proxies /api to the API. docker-compose.yml gains an optional "web" service (profile: frontend) so `docker compose --profile frontend up -d` runs the dev server alongside the API; `docker compose up -d` still starts the API alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
951 B
Vue
36 lines
951 B
Vue
<script setup lang="ts">
|
|
import { useAuthStore } from '../stores/auth'
|
|
|
|
const auth = useAuthStore()
|
|
</script>
|
|
|
|
<template>
|
|
<section class="card">
|
|
<h1>Your todo list</h1>
|
|
<p class="muted">
|
|
Placeholder page. The list and its items arrive in the next stage — for now
|
|
this screen just proves you are authenticated against the REST API.
|
|
</p>
|
|
|
|
<div v-if="!auth.emailVerified" class="notice">
|
|
Your email address <strong>{{ auth.user?.email }}</strong> has not been
|
|
verified yet. Verification will be added in a later stage.
|
|
</div>
|
|
|
|
<dl class="facts">
|
|
<div>
|
|
<dt>Signed in as</dt>
|
|
<dd>{{ auth.user?.email }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Account created</dt>
|
|
<dd>{{ auth.user?.created_at ?? '—' }}</dd>
|
|
</div>
|
|
<div>
|
|
<dt>Email verified</dt>
|
|
<dd>{{ auth.emailVerified ? 'yes' : 'no' }}</dd>
|
|
</div>
|
|
</dl>
|
|
</section>
|
|
</template>
|