- Phase 3 PW-Reset: 3 screens (forgot-password → reset-otp → new-password),
verifyOtp({type:'recovery'}), new updatePassword() action
- Custom Brevo-Mail templates (backend/public/templates/) — 5 HTMLs with
go-template i18n (de/en/fr/ar incl. RTL for AR), OTP-only (no link),
ReBreak branding
- signUp metadata.data.locale aus i18n.language → templates resolven Sprache
- Account-Switch-Bug fix: signOut() resettet alle 10 user-spezifischen stores
+ invalidateMe()
39 lines
956 B
TypeScript
39 lines
956 B
TypeScript
import { create } from 'zustand';
|
|
|
|
export type DeviceLimitDevice = {
|
|
id: string;
|
|
deviceId: string;
|
|
platform: string;
|
|
model: string | null;
|
|
name: string | null;
|
|
osVersion: string | null;
|
|
lastSeenAt: string;
|
|
createdAt: string;
|
|
isCurrent?: boolean;
|
|
};
|
|
|
|
type DeviceLimitState = {
|
|
visible: boolean;
|
|
devices: DeviceLimitDevice[];
|
|
max: number;
|
|
plan: string;
|
|
show: (devices: DeviceLimitDevice[], max: number, plan: string) => void;
|
|
hide: () => void;
|
|
removeDevice: (id: string) => void;
|
|
reset: () => void;
|
|
};
|
|
|
|
export const useDeviceLimitStore = create<DeviceLimitState>((set) => ({
|
|
visible: false,
|
|
devices: [],
|
|
max: 0,
|
|
plan: 'free',
|
|
|
|
show: (devices, max, plan) => set({ visible: true, devices, max, plan }),
|
|
hide: () => set({ visible: false }),
|
|
removeDevice: (id) =>
|
|
set((s) => ({ devices: s.devices.filter((d) => d.id !== id) })),
|
|
|
|
reset: () => set({ visible: false, devices: [], max: 0, plan: 'free' }),
|
|
}));
|