WP-01: authentication, user management and application shell
Argon2id password hashing, JWT access tokens with rotating HttpOnly refresh cookies and reuse detection, login rate limiting, auth audit log, bootstrap admin, admin-only user CRUD and password reset, OpenAPI spec. Vue login page, auth store with automatic token refresh, route guards, sidebar shell with toasts and placeholder pages, user management page. All tests green: 40 backend, 12 Vitest, 4 Playwright. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
23
frontend/src/stores/toast.ts
Normal file
23
frontend/src/stores/toast.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export interface Toast {
|
||||
id: number
|
||||
kind: 'success' | 'error'
|
||||
message: string
|
||||
}
|
||||
|
||||
export const useToastStore = defineStore('toast', () => {
|
||||
const items = ref<Toast[]>([])
|
||||
let next = 1
|
||||
function push(kind: Toast['kind'], message: string) {
|
||||
const id = next++
|
||||
items.value.push({ id, kind, message })
|
||||
setTimeout(() => (items.value = items.value.filter((t) => t.id !== id)), 4000)
|
||||
}
|
||||
return {
|
||||
items,
|
||||
success: (m: string) => push('success', m),
|
||||
error: (m: string) => push('error', m),
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user