From 301fb5fbbd63df12ad92d1563890900a6db39c0e Mon Sep 17 00:00:00 2001 From: Ahmed Muhammed Abdelaty Date: Sat, 2 Nov 2024 15:41:57 +0200 Subject: [PATCH] Fix: Fix logout endpoint StackOverflowError caused by Lombok. --- .../java/com/activecourses/upwork/model/RefreshToken.java | 6 ++---- .../java/com/activecourses/upwork/model/UserProfile.java | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/activecourses/upwork/model/RefreshToken.java b/src/main/java/com/activecourses/upwork/model/RefreshToken.java index 019cf4b..05599d1 100644 --- a/src/main/java/com/activecourses/upwork/model/RefreshToken.java +++ b/src/main/java/com/activecourses/upwork/model/RefreshToken.java @@ -1,10 +1,7 @@ package com.activecourses.upwork.model; import jakarta.persistence.*; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; +import lombok.*; import java.time.Instant; @@ -26,6 +23,7 @@ public class RefreshToken { @Column(nullable = false) private Instant expiryDate; + @ToString.Exclude @OneToOne @JoinColumn(name = "user_id", unique = true) private User user; diff --git a/src/main/java/com/activecourses/upwork/model/UserProfile.java b/src/main/java/com/activecourses/upwork/model/UserProfile.java index 7b8151c..ff21370 100644 --- a/src/main/java/com/activecourses/upwork/model/UserProfile.java +++ b/src/main/java/com/activecourses/upwork/model/UserProfile.java @@ -1,10 +1,7 @@ package com.activecourses.upwork.model; import jakarta.persistence.*; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; +import lombok.*; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import java.math.BigDecimal; @@ -28,9 +25,9 @@ public class UserProfile { @Column(precision = 19, scale = 2) // Example precision and scale private BigDecimal hourlyRate; - private String location; + @ToString.Exclude @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "user_id", unique = true) private User user;