Sesje sprawdzane w bazie, e-mail ogloszeniodawcy niepubliczny, zgody z formularza
Deploy Polska Lokalnie / deploy (push) Successful in 12s
Deploy Polska Lokalnie / deploy (push) Successful in 12s
- JwtAuthFilter bierze role i stan konta z bazy: blokada, usuniecie konta
i odebranie roli admina dzialaja od razu. Zmiana i reset hasla koncza
dotychczasowe sesje (sessionsValidFrom); zmiana hasla zwraca nowy token.
- Publiczne odpowiedzi ogloszen bez ownerEmail/contactEmail; inne oferty
sprzedajacego z GET /api/listings/{id}/seller-listings.
- Publiczny formularz reklamowy nie zmienia zgod ani nazwy istniejacego leada.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+9
-14
@@ -27125,25 +27125,20 @@ function ListingDetailPage({
|
||||
};
|
||||
}, [listingId]);
|
||||
|
||||
// Inne oferty tego samego sprzedajacego (po ownerEmail) - minimalistyczna lista na dole strony.
|
||||
// Inne oferty tego samego sprzedajacego - minimalistyczna lista na dole strony. Dopasowanie po
|
||||
// wlascicielu robi serwer, bo e-mail wlasciciela nie jest publiczny.
|
||||
useEffect(() => {
|
||||
const owner = listing?.ownerEmail?.trim().toLowerCase();
|
||||
if (!owner) {
|
||||
const currentId = listing?.id;
|
||||
if (currentId == null) {
|
||||
setSellerListings([]);
|
||||
return;
|
||||
}
|
||||
let cancelled = false;
|
||||
apiFetch<ApiListingSummary[]>('/listings')
|
||||
.then((all) => {
|
||||
if (cancelled) {
|
||||
return;
|
||||
apiFetch<ApiListingSummary[]>(`/listings/${currentId}/seller-listings`)
|
||||
.then((items) => {
|
||||
if (!cancelled) {
|
||||
setSellerListings(items);
|
||||
}
|
||||
setSellerListings(
|
||||
all
|
||||
.filter((item) => item.id !== listing?.id && item.ownerEmail
|
||||
&& item.ownerEmail.trim().toLowerCase() === owner)
|
||||
.slice(0, 6),
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
if (!cancelled) {
|
||||
@@ -27153,7 +27148,7 @@ function ListingDetailPage({
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [listing?.ownerEmail, listing?.id]);
|
||||
}, [listing?.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!listing) {
|
||||
|
||||
@@ -300,12 +300,13 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
return updated;
|
||||
}, []);
|
||||
|
||||
// Zmiana hasla konczy wszystkie dotychczasowe sesje - serwer oddaje nowy token dla tej.
|
||||
const changePassword = useCallback(async (currentPassword: string, newPassword: string) => {
|
||||
await apiFetch<void>('/auth/change-password', {
|
||||
applyAuth(await apiFetch<AuthResponse>('/auth/change-password', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ currentPassword, newPassword }),
|
||||
});
|
||||
}, []);
|
||||
}));
|
||||
}, [applyAuth]);
|
||||
|
||||
// Sprawdzenie dotychczasowego hasla bez zmiany czegokolwiek. Rzuca bledem, gdy haslo jest zle.
|
||||
const verifyPassword = useCallback(async (password: string) => {
|
||||
|
||||
Reference in New Issue
Block a user